~ubuntu-branches/ubuntu/saucy/keyutils/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/02-another-memleak.patch

  • Committer: Package Import Robot
  • Author(s): Luk Claes
  • Date: 2013-04-06 09:38:50 UTC
  • mfrom: (10.2.11 sid)
  • Revision ID: package-import@ubuntu.com-20130406093850-e6xnevgf3za1t4y3
Tags: 1.5.5-7
* Taking over with maintainer's consent.
* Adding watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: Michael Gebetsroither <gebi@grml.org>
2
 
Description: Fixed another memleak (Closes: #496466).
3
 
 
4
 
diff -Naurp keyutils.orig/keyutils.c keyutils/keyutils.c
5
 
--- keyutils.orig/keyutils.c    2011-08-22 11:47:35.344347556 +0200
6
 
+++ keyutils/keyutils.c 2011-08-22 11:47:42.920384030 +0200
7
 
@@ -261,8 +261,10 @@ int keyctl_describe_alloc(key_serial_t i
8
 
 
9
 
        for (;;) {
10
 
                ret = keyctl_describe(id, buf, buflen);
11
 
-               if (ret < 0)
12
 
+               if (ret < 0) {
13
 
+            free(buf);
14
 
                        return -1;
15
 
+        }
16
 
 
17
 
                if (buflen >= ret)
18
 
                        break;
19
 
@@ -300,8 +302,10 @@ int keyctl_read_alloc(key_serial_t id, v
20
 
 
21
 
        for (;;) {
22
 
                ret = keyctl_read(id, buf, buflen);
23
 
-               if (ret < 0)
24
 
+               if (ret < 0) {
25
 
+            free(buf);
26
 
                        return -1;
27
 
+        }
28
 
 
29
 
                if (buflen >= ret)
30
 
                        break;