openocd/src/xsvf
Antonio Borneo 4e98d44fd1 openocd: avoid checking for non NULL pointer to free it
The function free() can be called with a NULL pointer as argument,
no need to check the argument before. If the pointer is NULL, no
operation is performed by free().

Remove the occurrences of pattern:
	if (ptr)
		free(ptr);

While there replace a sequence malloc(size)+memset(,0,size) with a
calloc(1,size).
Replace a pointer assignment to '0' with an assignment to NULL.
In server/*, an error is logged if the ptr was already NULL. This
cannot happen since the pointer was already referenced few lines
before and openocd would have been already SIGSEGV in that case,
so remove the log.

Change-Id: I10822029fe8390b59edff4070575bf7f754e44ac
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5808
Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com>
Tested-by: jenkins
2020-09-05 17:11:50 +01:00
..
Makefile.am Convert to non-recursive make 2016-12-08 16:23:10 +00:00
xsvf.c openocd: avoid checking for non NULL pointer to free it 2020-09-05 17:11:50 +01:00
xsvf.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00