dect
/
linux-2.6
Archived
13
0
Fork 0

key: Fix resource leak

On an error iov may still have been reallocated and need freeing

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
Alan Cox 2012-09-28 12:20:02 +01:00 committed by David Howells
parent 631527703d
commit a84a921978
1 changed files with 2 additions and 2 deletions

View File

@ -1112,12 +1112,12 @@ long keyctl_instantiate_key_iov(key_serial_t id,
ret = rw_copy_check_uvector(WRITE, _payload_iov, ioc,
ARRAY_SIZE(iovstack), iovstack, &iov);
if (ret < 0)
return ret;
goto err;
if (ret == 0)
goto no_payload_free;
ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid);
err:
if (iov != iovstack)
kfree(iov);
return ret;