changeset 14181:27c84ba76954

6969276: minor memory leak detected by cppcheck in agent/src/os/linux/symtab.c Summary: missed free call on error return Reviewed-by: sla, sspitsyn, igerasim
author dsamersoff
date Wed, 18 Dec 2013 23:09:57 +0400
parents 03e9e2e3028b
children 21db9a1d43ef 6c583aa36bc9
files agent/src/os/linux/symtab.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/os/linux/symtab.c	Wed Dec 18 20:32:46 2013 +0400
+++ b/agent/src/os/linux/symtab.c	Wed Dec 18 23:09:57 2013 +0400
@@ -214,8 +214,10 @@
                                 + 2);
   strcpy(debug_pathname, name);
   char *last_slash = strrchr(debug_pathname, '/');
-  if (last_slash == NULL)
+  if (last_slash == NULL) {
+    free(debug_pathname);
     return -1;
+  }
 
   /* Look in the same directory as the object.  */
   strcpy(last_slash+1, debug_filename);