Page MenuHomeFreeBSD

D9691.diff
No OneTemporary

D9691.diff

Index: head/contrib/binutils/libiberty/make-relative-prefix.c
===================================================================
--- head/contrib/binutils/libiberty/make-relative-prefix.c
+++ head/contrib/binutils/libiberty/make-relative-prefix.c
@@ -299,10 +299,18 @@
full_progname = strdup(progname);
prog_dirs = split_directories (full_progname, &prog_num);
- bin_dirs = split_directories (bin_prefix, &bin_num);
+ if (prog_dirs == NULL)
+ {
+ free (full_progname);
+ return NULL;
+ }
free (full_progname);
- if (bin_dirs == NULL || prog_dirs == NULL)
- return NULL;
+ bin_dirs = split_directories (bin_prefix, &bin_num);
+ if (bin_dirs == NULL)
+ {
+ free_split_directories(prog_dirs);
+ return NULL;
+ }
/* Remove the program name from comparison of directory names. */
prog_num--;
@@ -365,7 +373,12 @@
ret = (char *) malloc (needed_len);
if (ret == NULL)
- return NULL;
+ {
+ free_split_directories (prog_dirs);
+ free_split_directories (bin_dirs);
+ free_split_directories (prefix_dirs);
+ return NULL;
+ }
/* Build up the pathnames in argv[0]. */
*ret = '\0';

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 23, 11:08 AM (45 m, 17 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31961967
Default Alt Text
D9691.diff (1 KB)

Event Timeline