David

You have also forgotten to free the second allocation. I see that you call
free_string(), which is in resources.c, but don't use the matching
new_string_header() function in that file - are these not intended to be a
matched pair for future GC purposes? I am assuming for now that both free()
calls should go in free_string() rather than one in string_destroy() but I
don't know exactly what you and/or Dan intended here.

Peter Gibbs
EmKel Systems


Index: resources.c
===================================================================
RCS file: /home/perlcvs/parrot/resources.c,v
retrieving revision 1.2
diff -c -r1.2 resources.c
*** resources.c 13 Dec 2001 00:51:10 -0000      1.2
--- resources.c 31 Dec 2001 20:03:28 -0000
***************
*** 27,31 ****
--- 27,32 ----
  }

  void free_string(STRING *string) {
+   free(string->bufstart);
    free(string);
  }




Reply via email to