mirror of
https://github.com/irssi/irssi.git
synced 2026-08-22 01:52:19 +02:00
xdg-support: fix memory leak using g_strdup_printf
This commit is contained in:
parent
6cf5de1fd1
commit
0ffa65348d
1 changed files with 4 additions and 2 deletions
|
|
@ -920,7 +920,7 @@ THEME_REC *theme_load(const char *setname)
|
||||||
{
|
{
|
||||||
THEME_REC *theme, *oldtheme;
|
THEME_REC *theme, *oldtheme;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
char *fname, *name, *p;
|
char *fname, *fbname, *name, *p;
|
||||||
|
|
||||||
name = g_strdup(setname);
|
name = g_strdup(setname);
|
||||||
p = strrchr(name, '.');
|
p = strrchr(name, '.');
|
||||||
|
|
@ -932,7 +932,9 @@ THEME_REC *theme_load(const char *setname)
|
||||||
theme = theme_find(name);
|
theme = theme_find(name);
|
||||||
|
|
||||||
/* check home dir */
|
/* check home dir */
|
||||||
fname = g_build_filename(get_irssi_dir(), g_strdup_printf("%s.theme", name), NULL);
|
fbname = g_strdup_printf("%s.theme", name); /* file base name */
|
||||||
|
fname = g_build_filename(get_irssi_dir(), fbname, NULL);
|
||||||
|
g_free(fbname);
|
||||||
if (stat(fname, &statbuf) != 0) {
|
if (stat(fname, &statbuf) != 0) {
|
||||||
/* check global config dir */
|
/* check global config dir */
|
||||||
g_free(fname);
|
g_free(fname);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue