mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-22 09:12:22 -05:00
Fix some leaks
This commit is contained in:
parent
ba399eb7f9
commit
b17c0276de
@ -756,6 +756,7 @@ XS (XS_HexChat_send_modes)
|
||||
}
|
||||
|
||||
if (target_count == 0) {
|
||||
free (targets);
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
|
@ -1029,6 +1029,7 @@ save_config (void)
|
||||
|
||||
if (!cfg_put_str (fh, "version", PACKAGE_VERSION))
|
||||
{
|
||||
close (fh);
|
||||
g_free (new_config);
|
||||
return 0;
|
||||
}
|
||||
@ -1041,6 +1042,7 @@ save_config (void)
|
||||
case TYPE_STR:
|
||||
if (!cfg_put_str (fh, vars[i].name, (char *) &prefs + vars[i].offset))
|
||||
{
|
||||
close (fh);
|
||||
g_free (new_config);
|
||||
return 0;
|
||||
}
|
||||
@ -1049,6 +1051,7 @@ save_config (void)
|
||||
case TYPE_BOOL:
|
||||
if (!cfg_put_int (fh, *((int *) &prefs + vars[i].offset), vars[i].name))
|
||||
{
|
||||
close (fh);
|
||||
g_free (new_config);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1805,7 +1805,10 @@ dcc_send (struct session *sess, char *to, char *file, int maxcps, int passive)
|
||||
|
||||
dcc = new_dcc ();
|
||||
if (!dcc)
|
||||
{
|
||||
free (file);
|
||||
return;
|
||||
}
|
||||
dcc->file = file;
|
||||
dcc->maxcps = maxcps;
|
||||
|
||||
|
@ -1659,7 +1659,10 @@ pevent_load (char *filename)
|
||||
if (fd == -1)
|
||||
return 1;
|
||||
if (fstat (fd, &st) != 0)
|
||||
{
|
||||
close (fd);
|
||||
return 1;
|
||||
}
|
||||
ibuf = malloc (st.st_size);
|
||||
read (fd, ibuf, st.st_size);
|
||||
close (fd);
|
||||
|
@ -1404,7 +1404,10 @@ util_exec (const char *cmd)
|
||||
#ifndef WIN32
|
||||
pid = fork ();
|
||||
if (pid == -1)
|
||||
{
|
||||
free (argv);
|
||||
return -1;
|
||||
}
|
||||
if (pid == 0)
|
||||
{
|
||||
/* Now close all open file descriptors except stdin, stdout and stderr */
|
||||
|
@ -176,6 +176,9 @@ userlist_button_cb (GtkWidget * button, char *cmd)
|
||||
if (num_sel < 1)
|
||||
{
|
||||
nick_command_parse (sess, cmd, "", "");
|
||||
|
||||
if (nicks)
|
||||
free (nicks);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user