[PATCH 05/11] parallels: Need to free memory on error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/parallels/parallels_utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/parallels/parallels_utils.c b/src/parallels/parallels_utils.c
index 171f5d0..0b589ab 100644
--- a/src/parallels/parallels_utils.c
+++ b/src/parallels/parallels_utils.c
@@ -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;
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]