public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: libiberty/make-relative-prefix.c, resource leak.
@ 2007-08-01  1:18 msnyder
  2007-08-03 16:32 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: msnyder @ 2007-08-01  1:18 UTC (permalink / raw)
  To: gcc-patches, gdb-patches, binutils; +Cc: ian, bje, dj, dberlin

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 302.txt --]
[-- Type: text/plain, Size: 1328 bytes --]

2007-07-31  Michael Snyder  <msnyder@access-company.com>

	* 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--;
  

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: libiberty/make-relative-prefix.c, resource leak.
  2007-08-01  1:18 PATCH: libiberty/make-relative-prefix.c, resource leak msnyder
@ 2007-08-03 16:32 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2007-08-03 16:32 UTC (permalink / raw)
  To: msnyder; +Cc: gcc-patches, gdb-patches, binutils, ian, bje, dj, dberlin

msnyder@sonic.net writes:

> 2007-07-31  Michael Snyder  <msnyder@access-company.com>
> 
> 	* make-relative-prefix.c (make_relative_prefix_1): Resource leak.

This is OK.

Please apply it to the gcc repository before the src repository.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-03 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01  1:18 PATCH: libiberty/make-relative-prefix.c, resource leak msnyder
2007-08-03 16:32 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).