projects
/
onak.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a72b8d
)
Ensure DB4 backend dbconns memory is initialised to zero
author
Jonathan McDowell
<noodles@earth.li>
Tue, 24 Mar 2009 20:47:43 +0000
(20:47 +0000)
committer
Jonathan McDowell
<noodles@earth.li>
Tue, 24 Mar 2009 20:47:43 +0000
(20:47 +0000)
Change to using calloc to allocate the memory for the dbconns array,
as this will ensure that all the pointers in it are NULL which
prevents us segfaulting on abnormal cleanup. Fixes the segfault from
Debian bug #520117 but not the underlying issue.
keydb_db4.c
patch
|
blob
|
history
diff --git
a/keydb_db4.c
b/keydb_db4.c
index e9dd5093d81f34511decf6629d9a3828f2923e7b..899075868b4d48df44cb4a49e2e6c03bcb1fb913 100644
(file)
--- a/
keydb_db4.c
+++ b/
keydb_db4.c
@@
-314,7
+314,7
@@
static void db4_initdb(bool readonly)
}
}
- dbconns =
malloc(sizeof (DB *) * numdbs
);
+ dbconns =
calloc(numdbs, sizeof (DB *)
);
if (dbconns == NULL) {
logthing(LOGTHING_CRITICAL,
"Couldn't allocate memory for dbconns");