]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
parallels: Need to free memory on error path
authorJohn Ferlan <jferlan@redhat.com>
Wed, 30 Jan 2013 12:55:19 +0000 (07:55 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 5 Feb 2013 21:51:07 +0000 (16:51 -0500)
src/parallels/parallels_utils.c

index 171f5d03d0ae104831cc8c0c54451739dcea527d..0b589abd234264b41b23f6ade30becbbf0c0bc43 100644 (file)
@@ -135,8 +135,10 @@ parallelsAddFileExt(const char *path, const char *ext)
         return NULL;
     }
 
-    if (!virStrcpy(new_path, path, len))
+    if (!virStrcpy(new_path, path, len)) {
+        VIR_FREE(new_path);
         return NULL;
+    }
     strcat(new_path, ext);
 
     return new_path;