forked from ariadne/pkgconf
main: free fragment lists in apply_cflags/apply_libs() in all cases (closes #131)
parent
f808300a01
commit
ed63a31b7a
6
main.c
6
main.c
|
@ -386,12 +386,13 @@ apply_cflags(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, int m
|
||||||
pkgconf_fragment_filter(client, &filtered_list, &unfiltered_list, filter_cflags, NULL);
|
pkgconf_fragment_filter(client, &filtered_list, &unfiltered_list, filter_cflags, NULL);
|
||||||
|
|
||||||
if (filtered_list.head == NULL)
|
if (filtered_list.head == NULL)
|
||||||
return true;
|
goto out;
|
||||||
|
|
||||||
render_buf = pkgconf_fragment_render(&filtered_list, true);
|
render_buf = pkgconf_fragment_render(&filtered_list, true);
|
||||||
printf("%s", render_buf);
|
printf("%s", render_buf);
|
||||||
free(render_buf);
|
free(render_buf);
|
||||||
|
|
||||||
|
out:
|
||||||
pkgconf_fragment_free(&unfiltered_list);
|
pkgconf_fragment_free(&unfiltered_list);
|
||||||
pkgconf_fragment_free(&filtered_list);
|
pkgconf_fragment_free(&filtered_list);
|
||||||
|
|
||||||
|
@ -414,12 +415,13 @@ apply_libs(pkgconf_client_t *client, pkgconf_pkg_t *world, void *unused, int max
|
||||||
pkgconf_fragment_filter(client, &filtered_list, &unfiltered_list, filter_libs, NULL);
|
pkgconf_fragment_filter(client, &filtered_list, &unfiltered_list, filter_libs, NULL);
|
||||||
|
|
||||||
if (filtered_list.head == NULL)
|
if (filtered_list.head == NULL)
|
||||||
return true;
|
goto out;
|
||||||
|
|
||||||
render_buf = pkgconf_fragment_render(&filtered_list, true);
|
render_buf = pkgconf_fragment_render(&filtered_list, true);
|
||||||
printf("%s", render_buf);
|
printf("%s", render_buf);
|
||||||
free(render_buf);
|
free(render_buf);
|
||||||
|
|
||||||
|
out:
|
||||||
pkgconf_fragment_free(&unfiltered_list);
|
pkgconf_fragment_free(&unfiltered_list);
|
||||||
pkgconf_fragment_free(&filtered_list);
|
pkgconf_fragment_free(&filtered_list);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue