changeset 411:ad2206c24986 api-inversion

Fix a memory corruption bug. When allocating the adb_t in audiodb_open(), zero the memory; then we're not going to try to free() or delete some arbitrary uninitialized thing if the thing that we're opening turns out not to be an audiodb database.
author mas01cr
date Thu, 11 Dec 2008 08:54:06 +0000
parents d7e590d58c85
children 223eda8408e1
files open.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/open.cpp	Thu Dec 11 08:54:01 2008 +0000
+++ b/open.cpp	Thu Dec 11 08:54:06 2008 +0000
@@ -56,7 +56,7 @@
     goto error;
   }
 
-  adb = (adb_t *) malloc(sizeof(adb_t));
+  adb = (adb_t *) calloc(1, sizeof(adb_t));
   if(!adb) {
     goto error;
   }