John Levon <[EMAIL PROTECTED]> writes: | On Wed, Nov 27, 2002 at 10:08:14PM +0000, Angus Leeming wrote: | | > Can't see nothing wrong with this... | > | > void fl_set_object_label(FL_OBJECT * ob, const char *label) { | > ... | > if (!label) | > label = ""; | > ... | > ob->label = fl_realloc(ob->label, strlen(label) + 1); | > strcpy(ob->label, label); | > } | | realloc(b, size) | { | free(b); | b = malloc(size); | } | | char * blah = "something"; | realloc(blah, sizeof("somethingelse")); | | you cannot free string literals
What string literal? fl_realloc is trying to free ob->label not label. my Q is what is ob->label set to? is it initialized? -- Lgb