On Tue, 2014-04-01 at 21:36 +0200, Gehad wrote:
> I couldn't find an easy way to use the memBuffer but I added Miika's 
> optimization, and fixed the memory leak. I think this is working fine.

+       char* temp = malloc(new_size);
...
+       strcpy(temp, str);

This is wrong (not in a bad way, but wasteful). You don't need new_size
for temp as that's just used to hold a copy of the original string.

        char *temp = strdup(str);


Lubomir was kind enough to address all the formatting issues with the
patch.

/D

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to