On Sunday 30 December 2007 19:41:06 Thorsten Haude wrote:
> * Ivan Skytte Jørgensen wrote (2007-10-15 22:52):
> >diff -r -U3 nedit.isj6/source/tags.c nedit.isj7/source/tags.c
> >--- nedit.isj6/source/tags.c    2007-03-05 00:26:05.000000000 +0100
> >+++ nedit.isj7/source/tags.c    2007-10-15 22:47:47.000000000 +0200
> >@@ -1218,6 +1218,7 @@
> >                 sprintf(temp,"%2d. %s%s",i+1,pathname,filename);
> >             if (!(dupTagsList[i] = (char *) malloc(strlen(temp) + 1))) {
> >                 fprintf(stderr, "NEdit: findDef(): out of heap
> > space!\n"); +                free(dupTagsList);
> >                 XBell(TheDisplay, 0);
> >                 return -1;
> >             }
>
> Shouldn't we unroll the for loop? There may already be malloced matches.

You are right. entries [0..i[ must be free()'ed

I think it is quickest if you just do that instead of me preparing a whole new 
patch.
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to