This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] main,c, captured_main, close memory leak (python)


Doug Evans wrote:
On Sun, Mar 6, 2011 at 2:33 PM, Michael Snyder <msnyder@vmware.com<mailto:msnyder@vmware.com>> wrote:
OK Doug?


2011-03-06 Michael Snyder <msnyder@vmware.com<mailto:msnyder@vmware.com>>


* main.c (captured_main): Fix memory leak.

Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.92
diff -u -p -r1.92 main.c
--- main.c      9 Jan 2011 03:20:33 -0000       1.92
+++ main.c      6 Mar 2011 22:31:09 -0000
@@ -352,11 +352,14 @@ captured_main (void *data)
                                   GDB_DATADIR_RELOCATABLE);

 #ifdef WITH_PYTHON_PATH
-  /* For later use in helping Python find itself.  */
-  python_libdir = relocate_directory (argv[0],
-                                     concat (WITH_PYTHON_PATH,
-                                             SLASH_STRING, "lib", NULL),
-                                     PYTHON_PATH_RELOCATABLE);
+  {
+    /* For later use in helping Python find itself.  */
+    char *tmp = concat (WITH_PYTHON_PATH, SLASH_STRING, "lib", NULL);
+
+    python_libdir = relocate_directory (argv[0], tmp,
+                                       PYTHON_PATH_RELOCATABLE);
+    xfree (tmp);
+  }
 #endif

#ifdef RELOC_SRCDIR



Sure.

Thanks, committed.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]