chiark / gitweb /
util: cunescape - fix memleak in error path
authorRonny Chevalier <chevalier.ronny@gmail.com>
Thu, 9 Apr 2015 09:00:35 +0000 (11:00 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 06:54:16 +0000 (07:54 +0100)
src/shared/util.c

index ffde3ff..ab891fa 100644 (file)
@@ -1525,6 +1525,7 @@ int cunescape_length_with_prefix(const char *s, size_t length, const char *prefi
                                 continue;
                         }
 
+                        free(r);
                         return -EINVAL;
                 }
 
@@ -1536,6 +1537,7 @@ int cunescape_length_with_prefix(const char *s, size_t length, const char *prefi
                                 continue;
                         }
 
+                        free(r);
                         return k;
                 }