pull-dkr: fix memleak
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 19 May 2015 17:23:53 +0000 (19:23 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 19 May 2015 17:24:47 +0000 (19:24 +0200)
src/import/pull-dkr.c

index 38c8db9..dd2097b 100644 (file)
@@ -1246,7 +1246,7 @@ finish:
 
 static int get_protocol_address(char **protocol, char **address, const char *url) {
         const char *sep, *dot;
-        char *a, *p;
+        _cleanup_free_ char *a = NULL, *p = NULL;
 
         sep = strstr(url, "://");
         if (!sep)
@@ -1270,6 +1270,7 @@ static int get_protocol_address(char **protocol, char **address, const char *url
 
         *address = a;
         *protocol = p;
+        a = p = NULL;
 
         return 0;
 }