X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=blobdiff_plain;f=libopkg%2Fparse_util.c;h=2aef7a9cce0544790a782f1266be946add44a3da;hp=fbecba6eb700954b811c6e09a712e02a00cee2f7;hb=ae179dcbb64f8797235f20521ac7dfcf3ce65ce4;hpb=cd113c7ea9d8883d9cdc4c3e4ea4f87531737183;ds=sidebyside diff --git a/libopkg/parse_util.c b/libopkg/parse_util.c index fbecba6..2aef7a9 100644 --- a/libopkg/parse_util.c +++ b/libopkg/parse_util.c @@ -35,7 +35,12 @@ is_field(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; } /*