]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: cunescape - fix memleak in error path
authorRonny Chevalier <chevalier.ronny@gmail.com>
Thu, 9 Apr 2015 09:00:35 +0000 (11:00 +0200)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Thu, 9 Apr 2015 16:47:52 +0000 (18:47 +0200)
src/shared/util.c

index 3a80f264ca1fb79965dd83dc4258312e89b962a2..23468b7af6d2e1243acb365dc12ae586b28bf9f2 100644 (file)
@@ -1505,6 +1505,7 @@ int cunescape_length_with_prefix(const char *s, size_t length, const char *prefi
                                 continue;
                         }
 
+                        free(r);
                         return -EINVAL;
                 }
 
@@ -1516,6 +1517,7 @@ int cunescape_length_with_prefix(const char *s, size_t length, const char *prefi
                                 continue;
                         }
 
+                        free(r);
                         return k;
                 }