From: Florian G. <re...@us...> - 2008-06-30 00:55:07
|
Update of /cvsroot/perfparse/_perfparse/libnagios_perfdata_parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15416/libnagios_perfdata_parser Modified Files: log_parser.c Log Message: Fixed bug where memory leaks when metric label is long Index: log_parser.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/libnagios_perfdata_parser/log_parser.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** log_parser.c 24 Aug 2006 14:36:45 -0000 1.5 --- log_parser.c 30 Jun 2008 00:55:14 -0000 1.6 *************** *** 3,7 **** * log_parser.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004 Yves Mettier (yme...@li...) * * $Id$ --- 3,8 ---- * log_parser.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004-2008 Yves Mettier (yme...@li...) ! * Florian Gleixner * * $Id$ *************** *** 80,83 **** --- 81,85 ---- perf_fields_new (void) { + //pp_log_func; perf_fields_t * data; data = malloc(sizeof(perf_fields_t)); *************** *** 96,99 **** --- 98,102 ---- const char* perf_value_get_range(const char*str, double *start,double *end, int *is_inverted) { + //pp_log_func; const char*p; char *p1; *************** *** 133,136 **** --- 136,140 ---- int perf_get_next(log_line_t *data, perf_fields_t *p) { + //pp_log_func; char*p1,*p2,*p3; int l; *************** *** 161,165 **** /* Reallocate memory for label if necessary */ l = p2-p1; ! if(l>= p->label_len) { p->label_len += 20; p->label = realloc(p->label,p->label_len*sizeof(char)); --- 165,169 ---- /* Reallocate memory for label if necessary */ l = p2-p1; ! while(l>= p->label_len) { p->label_len += 20; p->label = realloc(p->label,p->label_len*sizeof(char)); *************** *** 278,281 **** --- 282,286 ---- int perfstring_to_perfvalue_but_without_service_state(const char*str, perf_value_t *p) { + //pp_log_func; const char*p1; char *p2; *************** *** 344,347 **** --- 349,353 ---- int perfstring_to_perfvalue(const char*str, perf_value_t *p) { + //pp_log_func; int r; int inside; *************** *** 366,369 **** --- 372,376 ---- int line_split(char *line, log_line_t *data) { + //pp_log_func; int i; char*p; |