Doxyfile file description. Indentation. No change of code.
[yaz-moved-to-github.git] / src / odr_mem.c
index a18b372..5bd1289 100644 (file)
@@ -1,8 +1,12 @@
 /*
- * Copyright (c) 1995-2003, Index Data
+ * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: odr_mem.c,v 1.1 2003-10-27 12:21:33 adam Exp $
+ * $Id: odr_mem.c,v 1.3 2004-10-15 00:19:00 adam Exp $
+ */
+/**
+ * \file odr_mem.c
+ * \brief Implements ODR memory management
  */
 #if HAVE_CONFIG_H
 #include <config.h>
@@ -34,6 +38,8 @@ void *odr_malloc(ODR o, int size)
 
 char *odr_strdup(ODR o, const char *str)
 {
+    if (o && !o->mem)
+       o->mem = nmem_create();
     return nmem_strdup(o->mem, str);
 }
 
@@ -44,6 +50,8 @@ char *odr_strdupn(ODR o, const char *str, size_t n)
 
 int *odr_intdup(ODR o, int v)
 {
+    if (o && !o->mem)
+       o->mem = nmem_create();
     return nmem_intdup(o->mem, v);
 }