mirror of
https://github.com/crash-utility/crash
synced 2025-02-21 16:06:49 +00:00
Addressed three Coverity Scan complaints in vmware_vmss.c:
50:leaked_storage: Variable "fp" going out of scope leaks the storage it points to. 53:leaked_storage: Variable "fp" going out of scope leaks the storage it points to. 256⚠️ Use of memory after it is freed (anderson@redhat.com)
This commit is contained in:
parent
6c3f1463aa
commit
ceeeeaa2f7
@ -40,6 +40,8 @@ is_vmware_vmss(char *filename)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if (hdr.id != CPTDUMP_OLD_MAGIC_NUMBER &&
|
||||
hdr.id != CPTDUMP_MAGIC_NUMBER &&
|
||||
hdr.id != CPTDUMP_PARTIAL_MAGIC_NUMBER &&
|
||||
@ -252,8 +254,8 @@ vmware_vmss_init(char *filename, FILE *ofp)
|
||||
}
|
||||
strcpy(p, "vmem");
|
||||
if ((fp = fopen(vmem_filename, "r")) == NULL) {
|
||||
free(vmem_filename);
|
||||
error(INFO, LOGPRX"%s: %s\n", vmem_filename, strerror(errno));
|
||||
free(vmem_filename);
|
||||
return FALSE;
|
||||
}
|
||||
vmss.dfp = fp;
|
||||
|
Loading…
Reference in New Issue
Block a user