parallels: Need to free memory on error path

This commit is contained in:
John Ferlan 2013-01-30 07:55:19 -05:00
parent 3fa23653ee
commit 7f94521703

View 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;