mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Fixed memory leaks when destroying a channel, when loading nonexisten scripts and in topics, patch by Toby Peterson
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3707 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
a5fdd2358f
commit
19e800cf23
@ -89,6 +89,7 @@ void channel_destroy(CHANNEL_REC *channel)
|
|||||||
g_free_not_null(channel->key);
|
g_free_not_null(channel->key);
|
||||||
g_free(channel->mode);
|
g_free(channel->mode);
|
||||||
g_free(channel->name);
|
g_free(channel->name);
|
||||||
|
g_free(channel->visible_name);
|
||||||
|
|
||||||
channel->type = 0;
|
channel->type = 0;
|
||||||
g_free(channel);
|
g_free(channel);
|
||||||
|
@ -148,7 +148,8 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
|
|||||||
g_free_not_null(chanrec->topic);
|
g_free_not_null(chanrec->topic);
|
||||||
chanrec->topic = recoded == NULL ? NULL : g_strdup(recoded);
|
chanrec->topic = recoded == NULL ? NULL : g_strdup(recoded);
|
||||||
}
|
}
|
||||||
|
g_free(recoded);
|
||||||
|
|
||||||
g_free_not_null(chanrec->topic_by);
|
g_free_not_null(chanrec->topic_by);
|
||||||
chanrec->topic_by = g_strdup(setby);
|
chanrec->topic_by = g_strdup(setby);
|
||||||
|
|
||||||
|
@ -373,11 +373,13 @@ char *perl_script_get_path(const char *name)
|
|||||||
/* check from SCRIPTDIR */
|
/* check from SCRIPTDIR */
|
||||||
g_free(path);
|
g_free(path);
|
||||||
path = g_strdup_printf(SCRIPTDIR"/%s", file);
|
path = g_strdup_printf(SCRIPTDIR"/%s", file);
|
||||||
if (stat(path, &statbuf) != 0)
|
if (stat(path, &statbuf) != 0) {
|
||||||
path = NULL;
|
g_free(path);
|
||||||
|
path = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
g_free(file);
|
g_free(file);
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If core should handle printing script errors */
|
/* If core should handle printing script errors */
|
||||||
|
Loading…
Reference in New Issue
Block a user