Page MenuHomeFreeBSD

D9691.id25435.diff
No OneTemporary

D9691.id25435.diff

Index: contrib/binutils/libiberty/make-relative-prefix.c
===================================================================
--- contrib/binutils/libiberty/make-relative-prefix.c
+++ contrib/binutils/libiberty/make-relative-prefix.c
@@ -299,10 +299,16 @@
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)
+ 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--;
@@ -364,8 +370,12 @@
needed_len += 1; /* Trailing NUL. */
ret = (char *) malloc (needed_len);
- if (ret == NULL)
+ if (ret == 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
Wed, Dec 25, 8:17 AM (10 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15595775
Default Alt Text
D9691.id25435.diff (1 KB)

Event Timeline