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
--- a/hotspot/agent/src/os/linux/symtab.c Wed Dec 18 20:32:46 2013 +0400
+++ b/hotspot/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);