mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 10:04:42 +00:00
DM: fix memory leak
1. free memory allocated by strdup in blockif_open 2. free msix.table when its pci device deinit Tracked-On: #2704 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
@@ -759,8 +759,18 @@ blockif_open(const char *optstr, const char *ident)
|
||||
pthread_setname_np(bc->btid[i], tname);
|
||||
}
|
||||
|
||||
/* free strdup memory */
|
||||
if (nopt) {
|
||||
free(nopt);
|
||||
nopt = NULL;
|
||||
}
|
||||
|
||||
return bc;
|
||||
err:
|
||||
/* handle failure case: free strdup memory*/
|
||||
if (nopt)
|
||||
free(nopt);
|
||||
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user