Mercurial > hg > index.cgi
comparison lwlib/lw_stringlist.c @ 302:f29bebc279a8 ccdev
Fix memory leak in lw_stringlist_destroy()
Make sure to free all allocated memory in lw_stringlist_destroy()
author | William Astle <lost@l-w.ca> |
---|---|
date | Tue, 17 Sep 2013 19:10:36 -0600 |
parents | 2c24602be78f |
children |
comparison
equal
deleted
inserted
replaced
301:6f7fe78bb868 | 302:f29bebc279a8 |
---|---|
46 int i; | 46 int i; |
47 for (i = 0; i < S -> nstrings; i++) | 47 for (i = 0; i < S -> nstrings; i++) |
48 { | 48 { |
49 lw_free(S -> strings[i]); | 49 lw_free(S -> strings[i]); |
50 } | 50 } |
51 lw_free(S -> strings); | |
51 lw_free(S); | 52 lw_free(S); |
52 } | 53 } |
53 } | 54 } |
54 | 55 |
55 void lw_stringlist_addstring(lw_stringlist_t S, char *str) | 56 void lw_stringlist_addstring(lw_stringlist_t S, char *str) |