2007-07-31 Michael Snyder * make-relative-prefix.c (make_relative_prefix_1): Resource leak. Index: make-relative-prefix.c =================================================================== RCS file: /cvs/src/src/libiberty/make-relative-prefix.c,v retrieving revision 1.9 diff -p -r1.9 make-relative-prefix.c *** make-relative-prefix.c 11 Apr 2007 20:01:26 -0000 1.9 --- make-relative-prefix.c 1 Aug 2007 01:13:35 -0000 *************** make_relative_prefix_1 (const char *prog *** 299,309 **** full_progname = strdup(progname); prog_dirs = split_directories (full_progname, &prog_num); - bin_dirs = split_directories (bin_prefix, &bin_num); free (full_progname); ! if (bin_dirs == NULL || prog_dirs == NULL) return NULL; /* Remove the program name from comparison of directory names. */ prog_num--; --- 299,315 ---- full_progname = strdup(progname); prog_dirs = split_directories (full_progname, &prog_num); free (full_progname); ! if (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--;