summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 097e747..84c4c3a 100644
--- a/parse.c
+++ b/parse.c
@@ -414,14 +414,16 @@ rsRetVal parsAddrWithBits(rsParsObj *pThis, struct NetAddr **pIP, int *pBits)
/* now we have the string and must check/convert it to
* an NetAddr structure.
*/
- CHKiRet(cstrConvSzStrAndDestruct(pCStr, &pszIP, 0));
+ CHKiRet(cstrConvSzStrAndDestruct(&pCStr, &pszIP, 0));
- *pIP = calloc(1, sizeof(struct NetAddr));
+ if((*pIP = calloc(1, sizeof(struct NetAddr))) == NULL)
+ ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
if (*((char*)pszIP) == '[') {
pszTmp = (uchar*)strchr ((char*)pszIP, ']');
if (pszTmp == NULL) {
free (pszIP);
+ free (*pIP);
ABORT_FINALIZE(RS_RET_INVALID_IP);
}
*pszTmp = '\0';