X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fvms-lib.c;h=f000bc2a8f1fbf08fd9db209a0d872deb8090dc0;hb=5f8989944880cad1bfffab3801214a0a9b67b72e;hp=9504cf4976c0e839607be453d879cc62443ca329;hpb=765cf5f623dbc2de8c8791bce9a29fcc3492436c;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c index 9504cf4976..f000bc2a8f 100644 --- a/bfd/vms-lib.c +++ b/bfd/vms-lib.c @@ -1452,6 +1452,12 @@ _bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx) break; } bfd_set_filename (res, newname); + free (newname); + if (bfd_get_filename (res) == NULL) + { + bfd_close (res); + return NULL; + } tdata->cache[modidx] = res; @@ -2039,8 +2045,7 @@ _bfd_vms_lib_build_map (unsigned int nbr_modules, { if (storage > syms_max) { - if (syms_max > 0) - free (syms); + free (syms); syms_max = storage; syms = (asymbol **) bfd_malloc (syms_max); if (syms == NULL) @@ -2091,10 +2096,8 @@ _bfd_vms_lib_build_map (unsigned int nbr_modules, return TRUE; error_return: - if (syms_max > 0) - free (syms); - if (map != NULL) - free (map); + free (syms); + free (map); return FALSE; }