[PATCH 1/1] mcstrans: fix memory leaks reported by clang's static analyzer

2018-07-01 Thread Nicolas Iooss
There are many memory leaks in mcstrans. Clean them up in order to reduce the noise in clang's static analyzer report. Some are remaining, because they are more complex to fix. Signed-off-by: Nicolas Iooss --- mcstrans/src/mcstrans.c | 68 + 1 file changed

Re: [PATCH 1/1] mcstrans: fix memory leaks reported by clang's static analyzer

2018-07-01 Thread William Roberts
I see lots of repeating blocks, would it make more sense to goto an error label and free them then return -1? On Sun, Jul 1, 2018 at 7:57 AM, Nicolas Iooss wrote: > There are many memory leaks in mcstrans. Clean them up in order to > reduce the noise in clang's static analyzer report. Some are re

Re: [PATCH 1/1] mcstrans: fix memory leaks reported by clang's static analyzer

2018-07-02 Thread Nicolas Iooss
On Sun, Jul 1, 2018 at 10:51 PM, William Roberts wrote: > I see lots of repeating blocks, would it make more sense to goto an > error label and free them then return -1? Both trans_context() and untrans_context() currently define "char *ltrans = NULL, *utrans = NULL;" and "char *lrange = NULL, *u

Re: [PATCH 1/1] mcstrans: fix memory leaks reported by clang's static analyzer

2018-07-02 Thread William Roberts
On Mon, Jul 2, 2018 at 11:38 AM, Nicolas Iooss wrote: > On Sun, Jul 1, 2018 at 10:51 PM, William Roberts > wrote: >> I see lots of repeating blocks, would it make more sense to goto an >> error label and free them then return -1? > > Both trans_context() and untrans_context() currently define "ch

Re: [PATCH 1/1] mcstrans: fix memory leaks reported by clang's static analyzer

2018-07-04 Thread Nicolas Iooss
On Tue, Jul 3, 2018 at 12:49 AM, William Roberts wrote: > On Mon, Jul 2, 2018 at 11:38 AM, Nicolas Iooss wrote: >> On Sun, Jul 1, 2018 at 10:51 PM, William Roberts >> wrote: >>> I see lots of repeating blocks, would it make more sense to goto an >>> error label and free them then return -1? >> >