From 3bc4bd56a951aef36dcb37a8df27dcf35ac3847c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 19 Dec 2018 21:01:36 +0100 Subject: [PATCH] tag: tag_new_string(): allow NULL values (treat as empty string) --- tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag.c b/tag.c index 70a321b..e8760fc 100644 --- a/tag.c +++ b/tag.c @@ -262,7 +262,7 @@ tag_new_string(const char *name, const char *value) { struct private *priv = malloc(sizeof(*priv)); priv->name = strdup(name); - priv->value_as_string = strdup(value); + priv->value_as_string = value != NULL ? strdup(value) : strdup(""); struct tag *tag = malloc(sizeof(*tag)); tag->private = priv;