/* MMAPED DBM HASHING DATABASE */
-#include <ac/alloca.h>
#include <ac/string.h>
/* #define MDBM_DEBUG */
#ifdef NO_NULL_KEY
k.key.dsize = key.dsize + 1;
- k.key.dptr = alloca(k.key.dsize);
+ k.key.dptr = malloc(k.key.dsize);
*(k.key.dptr) = 'l';
memcpy( (void *)(k.key.dptr + 1), key.dptr, key.dsize );
#else
/* LDBM_UNLOCK; */
+#ifdef NO_NULL_KEY
+ free(k.key.dptr);
+#endif
+
return d;
}/* Datum ldbm_fetch() */
#ifdef NO_NULL_KEY
int_key.dsize = key.dsize + 1;
- int_key.dptr = alloca( int_key.dsize );
+ int_key.dptr = malloc( int_key.dsize );
*(int_key.dptr) = 'l'; /* Must not be NULL !*/
memcpy( (void *)(int_key.dptr + 1), key.dptr, key.dsize );
#else
fflush( stdout );
#endif
+#ifdef NO_NULL_KEY
+ free(int_key.dptr);
+#endif
+
return( rc );
}/* int ldbm_store() */
#ifdef NO_NULL_KEY
int_key.dsize = key.dsize + 1;
- int_key.dptr = alloca(int_key.dsize);
+ int_key.dptr = malloc(int_key.dsize);
*(int_key.dptr) = 'l';
memcpy( (void *)(int_key.dptr + 1), key.dptr, key.dsize );
#else
rc = mdbm_delete( ldbm, int_key );
/* LDBM_UNLOCK; */
+#ifdef NO_NULL_KEY
+ free(int_key.dptr);
+#endif
return( rc );
/* LDBM_LOCK; */
in.key.dsize = sz; /* Assume first key in one pg */
- in.key.dptr = alloca(sz);
+ in.key.dptr = malloc(sz);
in.val.dptr = NULL; /* Don't need data just key */
in.val.dsize = 0;
}
/* LDBM_UNLOCK; */
+
+ free(in.key.dptr);
return ret;