If the addr pointer is NULL, better to check first before using it.

This commit is contained in:
William King 2013-06-12 21:23:52 -07:00
parent a710841123
commit 3f2f393a7c
1 changed files with 2 additions and 3 deletions

View File

@ -213,12 +213,11 @@ int exprValListGetAddress(exprValList * vlist, char *name, EXPRTYPE ** addr)
exprVal *cur;
int result;
/* Not found yet */
*addr = NULL;
if (vlist == NULL || addr == NULL)
return EXPR_ERROR_NULLPOINTER;
/* Not found yet */
*addr = NULL;
if (name == NULL || name[0] == '\0')
return EXPR_ERROR_NOTFOUND;