From d533e710bc18b3edea03e39edb12d68f5eaaf096 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 17 Aug 2013 22:09:10 +0200 Subject: [PATCH] store: Support NULL attribute values. --- src/core/store.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/store.c b/src/core/store.c index dba88cd..eebe24b 100644 --- a/src/core/store.c +++ b/src/core/store.c @@ -219,9 +219,11 @@ sdb_attr_init(sdb_object_t *obj, va_list ap) return ret; value = va_arg(ap, const char *); - SDB_ATTR(obj)->value = strdup(value); - if (! SDB_ATTR(obj)->value) - return -1; + if (value) { + SDB_ATTR(obj)->value = strdup(value); + if (! SDB_ATTR(obj)->value) + return -1; + } return 0; } /* sdb_attr_init */ -- 2.30.2