mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-05 14:09:48 +01: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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314627
@ -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 New Issue
Block a user