Fix a memory leak in the test_printbuf test.

This commit is contained in:
Eric Haszlakiewicz
2012-11-29 13:29:55 -06:00
parent 23461c75dd
commit 447b88a115

View File

@@ -124,6 +124,7 @@ static void test_sprintbuf(int before_resize)
memset(data, 'X', before_resize + 1 + 1); memset(data, 'X', before_resize + 1 + 1);
data[before_resize + 1] = '\0'; data[before_resize + 1] = '\0';
sprintbuf(pb, "%s", data); 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)); 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); printbuf_reset(pb);