projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4603787
)
check before dereference.
author
Alan T. DeKok
<aland@freeradius.org>
Fri, 26 May 2017 14:54:14 +0000
(10:54 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Fri, 26 May 2017 14:54:14 +0000
(10:54 -0400)
Found by PVS-Studio
src/modules/rlm_passwd/rlm_passwd.c
patch
|
blob
|
history
diff --git
a/src/modules/rlm_passwd/rlm_passwd.c
b/src/modules/rlm_passwd/rlm_passwd.c
index
e8cd8af
..
b6b9ba0
100644
(file)
--- a/
src/modules/rlm_passwd/rlm_passwd.c
+++ b/
src/modules/rlm_passwd/rlm_passwd.c
@@
-134,10
+134,11
@@
static void release_hash_table(struct hashtable * ht){
int i;
if (!ht) return;
int i;
if (!ht) return;
- for (i = 0; i < ht->tablesize; i++)
- if (ht->table[i])
- destroy_password(ht->table[i]);
if (ht->table) {
if (ht->table) {
+ for (i = 0; i < ht->tablesize; i++) {
+ if (ht->table[i])
+ destroy_password(ht->table[i]);
+ }
free(ht->table);
ht->table = NULL;
}
free(ht->table);
ht->table = NULL;
}