projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
9aed7db
)
check ptr before dereferencing it. Found by PVS-Studio
author
Alan T. DeKok
<aland@freeradius.org>
Wed, 17 May 2017 15:51:44 +0000
(11:51 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Fri, 19 May 2017 18:06:53 +0000
(14:06 -0400)
src/lib/missing.c
patch
|
blob
|
history
diff --git
a/src/lib/missing.c
b/src/lib/missing.c
index
22fea07
..
95b8c54
100644
(file)
--- a/
src/lib/missing.c
+++ b/
src/lib/missing.c
@@
-321,10
+321,9
@@
HMAC_CTX *HMAC_CTX_new(void)
{
HMAC_CTX *ctx;
ctx = OPENSSL_malloc(sizeof(*ctx));
+ if (!ctx) return NULL;
+
memset(ctx, 0, sizeof(*ctx));
- if (ctx == NULL) {
- return NULL;
- }
HMAC_CTX_init(ctx);
return ctx;
}