From: Sebastian Harl Date: Sat, 17 Aug 2013 20:09:10 +0000 (+0200) Subject: store: Support NULL attribute values. X-Git-Tag: sysdb-0.1.0~375 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d533e710bc18b3edea03e39edb12d68f5eaaf096;p=sysdb.git store: Support NULL attribute values. --- 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 */