comparison lwlib/lw_stringlist.c @ 284:a1a88a8ddc98

Fix small memory leak in lw_stringlist_destroy() Make sure to free all allocated memory in lw_stringlist_destroy() instead of leaving the array of string pointers hanging about.
author William Astle <lost@l-w.ca>
date Tue, 17 Sep 2013 19:11:47 -0600
parents 2c24602be78f
children
comparison
equal deleted inserted replaced
283:210d261a614d 284:a1a88a8ddc98
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)