mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-20 12:00:43 +01:00
bugfix: plug a memleak in addAllowedSenderLine()
Error: RESOURCE_LEAK (CWE-772): rsyslog-7.4.10/runtime/net.c:876: alloc_arg: "parsAddrWithBits(rsParsObj *, struct NetAddr **, int *)" allocates memory that is stored into "uIP". rsyslog-7.4.10/parse.c:419:2: alloc_fn: Storage is returned from allocation function "calloc(size_t, size_t)". rsyslog-7.4.10/parse.c:419:2: var_assign: Assigning: "*pIP" = "calloc(1UL, 16UL)". rsyslog-7.4.10/runtime/net.c:882: noescape: Resource "uIP" is not freed or pointed-to in function "AddAllowedSender(struct AllowedSenders **, struct AllowedSenders **, struct NetAddr *, uint8_t)". rsyslog-7.4.10/runtime/net.c:619:27: noescape: "AddAllowedSender(struct AllowedSenders **, struct AllowedSenders **, struct NetAddr *, uint8_t)" does not free or save its pointer parameter "iAllow". rsyslog-7.4.10/runtime/net.c:890: leaked_storage: Variable "uIP" going out of scope leaks the storage it points to.
This commit is contained in:
parent
2943602d8f
commit
0a712f1025
@ -893,6 +893,7 @@ rsRetVal addAllowedSenderLine(char* pName, uchar** ppRestOfConfLine)
|
||||
errmsg.LogError(0, iRet, "Error %d adding allowed sender entry "
|
||||
"- terminating, nothing more will be added.", iRet);
|
||||
rsParsDestruct(pPars);
|
||||
free(uIP);
|
||||
return(iRet);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user