libpkgconf: pkg: pkgconf_try_specific_path() and pkgconf_pkg_new_from_file() require a mutable client to release resources when encountering invalid packages

pull/119/head
William Pitcock 2017-05-19 23:21:58 -05:00
parent 4b104d49df
commit cf3c50ca78
2 changed files with 3 additions and 3 deletions

View File

@ -250,7 +250,7 @@ pkgconf_pkg_t *pkgconf_scan_all(pkgconf_client_t *client, void *ptr, pkgconf_pkg
void pkgconf_pkg_dir_list_build(pkgconf_client_t *client);
/* parse.c */
pkgconf_pkg_t *pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *path, FILE *f);
pkgconf_pkg_t *pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *path, FILE *f);
void pkgconf_dependency_parse_str(const pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends);
void pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist_head, const char *depends);
void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail);

View File

@ -233,7 +233,7 @@ determine_prefix(const pkgconf_pkg_t *pkg)
* :rtype: pkgconf_pkg_t *
*/
pkgconf_pkg_t *
pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *filename, FILE *f)
pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *f)
{
pkgconf_pkg_t *pkg;
char readbuf[PKGCONF_BUFSIZE];
@ -436,7 +436,7 @@ pkgconf_pkg_unref(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
}
static inline pkgconf_pkg_t *
pkgconf_pkg_try_specific_path(const pkgconf_client_t *client, const char *path, const char *name)
pkgconf_pkg_try_specific_path(pkgconf_client_t *client, const char *path, const char *name)
{
pkgconf_pkg_t *pkg = NULL;
FILE *f;