diff options
author | Sebastian Thorarensen <sebth@naju.se> | 2014-06-19 01:11:08 +0200 |
---|---|---|
committer | Sebastian Thorarensen <sebth@naju.se> | 2014-07-06 23:24:10 +0200 |
commit | ff08b3b0224848bf1c4c4e4e8e73c081570f82c9 (patch) | |
tree | dacdcdffb5ae0e6ce02adadcde2fe092c16382b1 /src/irc | |
parent | 7bfe3a8fa1e9d59f94583390f2904d2f9204b9b5 (diff) | |
download | irssi-ff08b3b0224848bf1c4c4e4e8e73c081570f82c9.zip |
Replace a `goto out' with explicit freeing
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-servers.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index e1e79321..13784f88 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -87,7 +87,7 @@ static char **split_line(const SERVER_REC *server, const char *line, const char *end = settings_get_str("split_line_end"); char *recoded_start = recode_out(server, start, target); char *recoded_end = recode_out(server, end, target); - char **lines = NULL; + char **lines; int i; /* @@ -96,8 +96,12 @@ static char **split_line(const SERVER_REC *server, const char *line, * the code much simpler. It's worth it. */ len -= strlen(recoded_start) + strlen(recoded_end); - if (len <= 0) - goto out; /* There is no room for anything. */ + if (len <= 0) { + /* There is no room for anything. */ + g_free(recoded_start); + g_free(recoded_end); + return NULL; + } lines = recode_split(server, line, target, len); for (i = 0; lines[i] != NULL; i++) { @@ -137,7 +141,6 @@ static char **split_line(const SERVER_REC *server, const char *line, } } -out: g_free(recoded_start); g_free(recoded_end); return lines; |