diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-05-11 20:54:50 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-05-11 20:54:50 +0200 |
commit | 25bc4e84e9ef8df694937b107111160e707e0299 (patch) | |
tree | a1ce48aa786af8f318a0833e7ac99fba8108d228 /sys/src/cmd/python/Tools/compiler/demo.py | |
parent | fe073f852a0c085c99545b361e948d29023531c8 (diff) |
devmnt: fix mount device leak and allocation error handling in mntversion()
the fist problem is that qopen() might return nil and that kstrdup() will
sleep, so we should try to avoid holding the mntalloc lock. so we move
the kstrdup() and qopen() calls before the Mnt allocation, and properly
recover the memory if we fail later.
the second problem was that we error(Eshort) after we already created the Mnt
when returnlen < sizeof(f.version). this check has to happen *before* we
even attempt to allocate the Mnt structures. note that we only copy the
version string once everything is in the clear, so the semantics of the
user buffer not being modified in case of error is not changed.
a little cleanup in muxclose(), getting rid of mntptfree()...
Diffstat (limited to 'sys/src/cmd/python/Tools/compiler/demo.py')
0 files changed, 0 insertions, 0 deletions