libpkgconf: fragment: check pkgconf_argv_split() return value

feature/tap-sh
William Pitcock 2017-09-19 21:34:24 -05:00
parent 56101390ac
commit 7786554be2
1 changed files with 8 additions and 2 deletions

View File

@ -613,11 +613,17 @@ pkgconf_fragment_free(pkgconf_list_t *list)
void
pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value)
{
int i, argc;
int i, ret, argc;
char **argv;
char *repstr = pkgconf_tuple_parse(client, vars, value);
pkgconf_argv_split(repstr, &argc, &argv);
ret = pkgconf_argv_split(repstr, &argc, &argv);
if (ret < 0)
{
PKGCONF_TRACE(client, "unable to parse fragment string [%s]", repstr);
free(repstr);
return;
}
for (i = 0; i < argc && argv[i] != NULL; i++)
pkgconf_fragment_add(client, list, argv[i]);