mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Fix leak (free str before returning when ctx's calloc fails).
Submitted by: trix_juniper.net (Tom Rix) Discovered by: clang's static analyzer MFC after: 4 days Relnotes: ngie Differential Revision: D9877
This commit is contained in:
parent
8a8bea603c
commit
56d5bb4c63
1 changed files with 3 additions and 1 deletions
|
|
@ -124,8 +124,10 @@ snmpv2_parse(char **strings)
|
|||
str = strdup(*strings);
|
||||
|
||||
ctx = calloc(1, sizeof(*ctx));
|
||||
if (ctx == NULL)
|
||||
if (ctx == NULL) {
|
||||
free(str);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ctx->fd = -1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue