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:
Dave Anderson 2015-02-12 14:35:33 -05:00
parent 6c3f1463aa
commit ceeeeaa2f7

View File

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