Merge pull request #202 from oneru/patch-1
Check for non-null pointer value
This commit is contained in:
commit
342983f94c
@ -153,6 +153,17 @@ static void
|
||||
add_acc_b64_string(char **var, int *len, const char *val, FILE *file_ptr,
|
||||
fko_srv_options_t *opts)
|
||||
{
|
||||
if(var == NULL)
|
||||
{
|
||||
log_msg(LOG_ERR, "[*] add_acc_b64_string() called with NULL variable");
|
||||
if(file_ptr != NULL)
|
||||
fclose(file_ptr);
|
||||
clean_exit(opts, NO_FW_CLEANUP, EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if(*var != NULL)
|
||||
free(*var);
|
||||
|
||||
if((*var = strdup(val)) == NULL)
|
||||
{
|
||||
log_msg(LOG_ERR,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user