From: Eric Haszlakiewicz Date: Thu, 29 Nov 2012 19:29:55 +0000 (-0600) Subject: Fix a memory leak in the test_printbuf test. X-Git-Tag: json-c-0.11-20130402~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=447b88a115cc98589625742a21e5d7475c4dba2e;p=thirdparty%2Fjson-c.git Fix a memory leak in the test_printbuf test. --- diff --git a/tests/test_printbuf.c b/tests/test_printbuf.c index 9a465669..fed185e1 100644 --- a/tests/test_printbuf.c +++ b/tests/test_printbuf.c @@ -124,6 +124,7 @@ static void test_sprintbuf(int before_resize) memset(data, 'X', before_resize + 1 + 1); data[before_resize + 1] = '\0'; sprintbuf(pb, "%s", data); + free(data); printf("sprintbuf to just after resize(%d+1): %d, [%s], strlen(buf)=%d\n", before_resize, printbuf_length(pb), pb->buf, (int)strlen(pb->buf)); printbuf_reset(pb);