tag: tag_new_string(): allow NULL values (treat as empty string)

This commit is contained in:
Daniel Eklöf 2018-12-19 21:01:36 +01:00
parent 7f2c0681a7
commit 3bc4bd56a9

2
tag.c
View file

@ -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;