comparison agent/src/os/linux/symtab.c @ 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 f2512d89ad0c
children db1ff6781ab4
comparison
equal deleted inserted replaced
14180:03e9e2e3028b 14181:27c84ba76954
212 + strlen(".debug/") 212 + strlen(".debug/")
213 + strlen(debug_file_directory) 213 + strlen(debug_file_directory)
214 + 2); 214 + 2);
215 strcpy(debug_pathname, name); 215 strcpy(debug_pathname, name);
216 char *last_slash = strrchr(debug_pathname, '/'); 216 char *last_slash = strrchr(debug_pathname, '/');
217 if (last_slash == NULL) 217 if (last_slash == NULL) {
218 free(debug_pathname);
218 return -1; 219 return -1;
220 }
219 221
220 /* Look in the same directory as the object. */ 222 /* Look in the same directory as the object. */
221 strcpy(last_slash+1, debug_filename); 223 strcpy(last_slash+1, debug_filename);
222 224
223 debug_fd = open_debug_file(debug_pathname, crc); 225 debug_fd = open_debug_file(debug_pathname, crc);