Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106040426
D9691.id25435.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D9691.id25435.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9691: Fix a memory leak in libiberty
Attached
Detach File
Event Timeline
Log In to Comment