From dd89a55a9b54e29da43d6adea00fc2c42e3e7ebd Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 15 May 2006 19:57:12 +0200 Subject: Fixed various memory leaks/other possible problems after code review. --- conf.c | 2 +- ipc.c | 1 + irc.c | 2 +- protocols/nogaim.c | 3 ++- protocols/oscar/service.c | 3 ++- set.c | 6 +++++- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/conf.c b/conf.c index 0bd9cbc8..7538825d 100644 --- a/conf.c +++ b/conf.c @@ -94,7 +94,7 @@ conf_t *conf_load( int argc, char *argv[] ) } conf->port = i; } - else if( opt == 'p' ) + else if( opt == 'P' ) { g_free( conf->pidfile ); conf->pidfile = g_strdup( optarg ); diff --git a/ipc.c b/ipc.c index 1a382f9b..18d3284e 100644 --- a/ipc.c +++ b/ipc.c @@ -570,5 +570,6 @@ int ipc_master_load_state() ipc_to_children_str( "HELLO\r\n" ); ipc_to_children_str( "OPERMSG :New BitlBee master process started (version " BITLBEE_VERSION ")\r\n" ); + fclose( fp ); return 1; } diff --git a/irc.c b/irc.c index 44fc9ad3..3cdd03cb 100644 --- a/irc.c +++ b/irc.c @@ -556,7 +556,7 @@ int irc_usermsg( irc_t *irc, char *format, ... ) user_t *u; u = user_find( irc, irc->mynick ); - if( u ) is_private = u->is_private; + is_private = u->is_private; va_start( params, format ); g_vsnprintf( text, sizeof( text ), format, params ); diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 51d08e5a..eee104c4 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -611,7 +611,8 @@ void serv_got_update( struct gaim_connection *gc, char *handle, int loggedin, in return; } - return; + /* Why did we have this here.... + return; */ } oa = u->away != NULL; diff --git a/protocols/oscar/service.c b/protocols/oscar/service.c index 4519ce14..4596974f 100644 --- a/protocols/oscar/service.c +++ b/protocols/oscar/service.c @@ -880,13 +880,14 @@ int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, guint32 offset, guin aimbs_put32(&fr->data, 0xa46d3b39); #endif +/* len can't be 0 here anyway... } else if ((offset == 0x00001000) && (len == 0x00000000)) { aimbs_put32(&fr->data, 0xd41d8cd9); aimbs_put32(&fr->data, 0x8f00b204); aimbs_put32(&fr->data, 0xe9800998); aimbs_put32(&fr->data, 0xecf8427e); - +*/ } else do_error_dialog(sess->aux_data, "WARNING: unknown hash request", "Gaim"); diff --git a/set.c b/set.c index 4207df81..60912e10 100644 --- a/set.c +++ b/set.c @@ -149,7 +149,11 @@ void set_del( irc_t *irc, char *key ) } if( s ) { - t->next = s->next; + if( t ) + t->next = s->next; + else + irc->set = s->next; + g_free( s->key ); if( s->value ) g_free( s->value ); if( s->def ) g_free( s->def ); -- cgit v1.2.3