forked from ariadne/pkgconf
libpkgconf: path: add cleanup functions
parent
b7984a795c
commit
e7f4846508
|
@ -33,6 +33,7 @@ void
|
||||||
pkgconf_client_deinit(pkgconf_client_t *client)
|
pkgconf_client_deinit(pkgconf_client_t *client)
|
||||||
{
|
{
|
||||||
pkgconf_tuple_free_global(client);
|
pkgconf_tuple_free_global(client);
|
||||||
|
pkgconf_path_free(&client->dir_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -260,5 +260,6 @@ void pkgconf_path_add(const char *text, pkgconf_list_t *dirlist);
|
||||||
size_t pkgconf_path_split(const char *text, pkgconf_list_t *dirlist);
|
size_t pkgconf_path_split(const char *text, pkgconf_list_t *dirlist);
|
||||||
size_t pkgconf_path_build_from_environ(const char *environ, const char *fallback, pkgconf_list_t *dirlist);
|
size_t pkgconf_path_build_from_environ(const char *environ, const char *fallback, pkgconf_list_t *dirlist);
|
||||||
bool pkgconf_path_match_list(const char *path, pkgconf_list_t *dirlist);
|
bool pkgconf_path_match_list(const char *path, pkgconf_list_t *dirlist);
|
||||||
|
void pkgconf_path_free(pkgconf_list_t *dirlist);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -78,3 +78,17 @@ pkgconf_path_match_list(const char *path, pkgconf_list_t *dirlist)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pkgconf_path_free(pkgconf_list_t *dirlist)
|
||||||
|
{
|
||||||
|
pkgconf_node_t *n, *tn;
|
||||||
|
|
||||||
|
PKGCONF_FOREACH_LIST_ENTRY_SAFE(dirlist->head, tn, n)
|
||||||
|
{
|
||||||
|
pkgconf_path_t *pnode = n->data;
|
||||||
|
|
||||||
|
free(pnode->path);
|
||||||
|
free(pnode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue