From de4de93d9ea99bbe023ebd5d2dfc5542fad66f75 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 11 Aug 2009 14:00:57 +0000 Subject: [PATCH] fix freeing order when generating error messages. found by Dmitry V. Krivenok git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1889 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_restore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index 4cbc37ad..46a79b5a 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -294,13 +294,14 @@ static int get_xml_double( } errno = 0; temp = strtod((char *)text,NULL); - xmlFree(text); if (errno>0){ rrd_set_error("ling %d: get_xml_double from '%s' %s", xmlTextReaderGetParserLineNumber(reader), text,rrd_strerror(errno)); + xmlFree(text); return -1; } + xmlFree(text); *value = temp; return 0; } -- 2.30.2