diff options
author | kyak <bas@bmail.ru> | 2015-08-29 15:29:57 +0300 |
---|---|---|
committer | kyak <bas@bmail.ru> | 2015-08-29 15:29:57 +0300 |
commit | 19760679eb141baf3bff2110ee03aec90c653a2a (patch) | |
tree | ce954eeffa79760ace8d1b6f5349e0d534cc314f /src/irc | |
parent | 0435331912f5d975c4cbef9b018bb89c07e610eb (diff) | |
download | irssi-19760679eb141baf3bff2110ee03aec90c653a2a.zip |
In expando_hostname, set *free_ret to TRUE
*free_ret must be set to TRUE in both cases, since we return
some newly initialised memory
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-expandos.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/irc/core/irc-expandos.c b/src/irc/core/irc-expandos.c index f26c9699..4aa50c52 100644 --- a/src/irc/core/irc-expandos.c +++ b/src/irc/core/irc-expandos.c @@ -86,6 +86,8 @@ static char *expando_hostname(SERVER_REC *server, void *item, int *free_ret) ircserver = IRC_SERVER(server); + *free_ret = TRUE; + /* prefer the _real_ /userhost reply */ if (ircserver != NULL && ircserver->userhost != NULL) { list = g_strsplit(ircserver->userhost, "@", -1); @@ -95,8 +97,6 @@ static char *expando_hostname(SERVER_REC *server, void *item, int *free_ret) } /* haven't received userhost reply yet. guess something */ - *free_ret = TRUE; - if (gethostname(hostname, sizeof(hostname)) != 0 || *hostname == '\0') strcpy(hostname, "??"); return g_strdup(hostname); |