small memory leak fix #225
|
@ -802,6 +802,7 @@ main(int argc, char *argv[])
|
||||||
char *want_env_prefix = NULL;
|
char *want_env_prefix = NULL;
|
||||||
unsigned int want_client_flags = PKGCONF_PKG_PKGF_NONE;
|
unsigned int want_client_flags = PKGCONF_PKG_PKGF_NONE;
|
||||||
pkgconf_cross_personality_t *personality;
|
pkgconf_cross_personality_t *personality;
|
||||||
|
bool opened_error_msgout = false;
|
||||||
|
|
||||||
want_flags = 0;
|
want_flags = 0;
|
||||||
|
|
||||||
|
@ -1027,8 +1028,10 @@ main(int argc, char *argv[])
|
||||||
error_msgout = stderr;
|
error_msgout = stderr;
|
||||||
if ((want_flags & PKG_ERRORS_ON_STDOUT) == PKG_ERRORS_ON_STDOUT)
|
if ((want_flags & PKG_ERRORS_ON_STDOUT) == PKG_ERRORS_ON_STDOUT)
|
||||||
error_msgout = stdout;
|
error_msgout = stdout;
|
||||||
if ((want_flags & PKG_SILENCE_ERRORS) == PKG_SILENCE_ERRORS)
|
if ((want_flags & PKG_SILENCE_ERRORS) == PKG_SILENCE_ERRORS) {
|
||||||
error_msgout = fopen(PATH_DEV_NULL, "w");
|
error_msgout = fopen(PATH_DEV_NULL, "w");
|
||||||
|
opened_error_msgout = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ((want_flags & PKG_IGNORE_CONFLICTS) == PKG_IGNORE_CONFLICTS || getenv("PKG_CONFIG_IGNORE_CONFLICTS") != NULL)
|
if ((want_flags & PKG_IGNORE_CONFLICTS) == PKG_IGNORE_CONFLICTS || getenv("PKG_CONFIG_IGNORE_CONFLICTS") != NULL)
|
||||||
want_client_flags |= PKGCONF_PKG_PKGF_SKIP_CONFLICTS;
|
want_client_flags |= PKGCONF_PKG_PKGF_SKIP_CONFLICTS;
|
||||||
|
@ -1454,10 +1457,13 @@ out_println:
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
pkgconf_cross_personality_deinit(personality);
|
||||||
pkgconf_client_deinit(&pkg_client);
|
pkgconf_client_deinit(&pkg_client);
|
||||||
|
|
||||||
if (logfile_out != NULL)
|
if (logfile_out != NULL)
|
||||||
fclose(logfile_out);
|
fclose(logfile_out);
|
||||||
|
if (opened_error_msgout)
|
||||||
|
fclose(error_msgout);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,6 +231,7 @@ PKGCONF_API void pkgconf_client_dir_list_build(pkgconf_client_t *client, const p
|
||||||
/* personality.c */
|
/* personality.c */
|
||||||
PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_default(void);
|
PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_default(void);
|
||||||
PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_find(const char *triplet);
|
PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_find(const char *triplet);
|
||||||
|
PKGCONF_API void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality);
|
||||||
|
|
||||||
#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned int)(c)))
|
#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned int)(c)))
|
||||||
#define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=')
|
#define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=')
|
||||||
|
|
|
@ -103,6 +103,14 @@ pkgconf_cross_personality_default(void)
|
||||||
return &default_personality;
|
return &default_personality;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality)
|
||||||
|
{
|
||||||
|
pkgconf_path_free(&personality->dir_list);
|
||||||
|
pkgconf_path_free(&personality->filter_libdirs);
|
||||||
|
pkgconf_path_free(&personality->filter_includedirs);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef PKGCONF_LITE
|
#ifndef PKGCONF_LITE
|
||||||
static bool
|
static bool
|
||||||
valid_triplet(const char *triplet)
|
valid_triplet(const char *triplet)
|
||||||
|
|
Loading…
Reference in New Issue