openocd/src/helper
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
..
bin2char.sh helper: fix minor typos 2020-09-05 17:10:54 +01:00
binarybuffer.c Fix debug prints when loading to flash 2020-09-05 16:48:08 +01:00
binarybuffer.h Fix debug prints when loading to flash 2020-09-05 16:48:08 +01:00
bits.h helper: add bitmap helper primitives 2019-06-06 16:32:57 +01:00
command.c helper/command: remove unused functions and make static local ones 2020-05-24 21:36:48 +01:00
command.h helper: fix minor typos 2020-09-05 17:10:54 +01:00
configuration.c helper/configuration: free script_search_dirs and config_file_names 2018-03-07 23:47:31 +00:00
configuration.h helper/configuration: free script_search_dirs and config_file_names 2018-03-07 23:47:31 +00:00
fileio.c Handle improperly build image files gracefully 2018-02-14 08:27:01 +00:00
fileio.h Handle improperly build image files gracefully 2018-02-14 08:27:01 +00:00
ioutil_stubs.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
ioutil.c openocd: avoid checking for non NULL pointer to free it 2020-09-05 17:11:50 +01:00
ioutil.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
jep106.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
jep106.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
jep106.inc helper: Update jep106 database to JEP106AT 2016-12-08 12:30:14 +00:00
jim-nvp.c jim-nvp: Make Jim_GetOpt_String const-correct 2016-02-29 20:32:31 +00:00
jim-nvp.h helper: fix minor typos 2020-09-05 17:10:54 +01:00
list.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
log.c helper: fix minor typos 2020-09-05 17:10:54 +01:00
log.h helper: fix minor typos 2020-09-05 17:10:54 +01:00
Makefile.am helper: add bitmap helper primitives 2019-06-06 16:32:57 +01:00
options.c helper: skip including sys/sysctl.h on Linux 2019-11-23 22:47:33 +00:00
replacements.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
replacements.h helper/replacements.h: Add missing #include 2018-03-07 23:43:58 +00:00
startup.tcl coding style: src: remove empty lines at end of text files 2020-05-02 15:40:21 +01:00
system.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
time_support_common.c Fix usage of timeval_ms() 2016-07-19 10:45:16 +01:00
time_support.c Add timeval_compare helper function 2018-01-25 16:43:45 +00:00
time_support.h Add timeval_compare helper function 2018-01-25 16:43:45 +00:00
types.h Remove BUILD_TARGET64 2020-04-21 12:55:41 +01:00
update_jep106.pl helper: fix minor typos 2020-09-05 17:10:54 +01:00
util.c helper: fix minor typos 2020-09-05 17:10:54 +01:00
util.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00