buildroot/package/keyutils/keyutils-02-another-memleak.patch
Yann E. MORIN 90934a3de8 package/keyutils: new package
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-16 21:39:50 +01:00

33 lines
815 B
Diff

Patch vampirised from Debian's packaging of keyutils-1.4
Author: Michael Gebetsroither <gebi@grml.org>
Description: Fixed another memleak (Closes: #496466).
diff -Naurp keyutils.orig/keyutils.c keyutils/keyutils.c
--- keyutils.orig/keyutils.c 2008-08-09 21:46:52.000000000 +0200
+++ keyutils/keyutils.c 2008-08-25 13:38:25.000000000 +0200
@@ -187,8 +187,10 @@ int keyctl_describe_alloc(key_serial_t i
for (;;) {
ret = keyctl_describe(id, buf, buflen);
- if (ret < 0)
+ if (ret < 0) {
+ free(buf);
return -1;
+ }
if (buflen >= ret)
break;
@@ -226,8 +228,10 @@ int keyctl_read_alloc(key_serial_t id, v
for (;;) {
ret = keyctl_read(id, buf, buflen);
- if (ret < 0)
+ if (ret < 0) {
+ free(buf);
return -1;
+ }
if (buflen >= ret)
break;