If the resulting string is empty after whitespace trimming, free it and
store NULL instead of an empty string buffer.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
char *
parse_simple(const char *type, const char *line)
{
char *
parse_simple(const char *type, const char *line)
{
- return trim_xstrdup(line + strlen(type) + 1);
+ char *field = trim_xstrdup(line + strlen(type) + 1);
+ if (strlen(field) == 0) {
+ free(field);
+ return NULL;
+ }
+ return field;