# HG changeset patch # User Luke Schierer # Date 1069601545 0 # Node ID 08c9d0dcf906cf79e08a922a7faee09dfb5f6166 # Parent 7b9630667f43724413ed2b10bcd9be9a05ecd1e8 [gaim-migrate @ 8229] " Some things allocated with g_malloc() were being free()'d instead of g_free()'d This patch fixes the ones I managed to find." --Stu Tomlinson (nosnilmot) committer: Tailor Script diff -r 7b9630667f43 -r 08c9d0dcf906 plugins/spellchk.c --- a/plugins/spellchk.c Sun Nov 23 15:25:04 2003 +0000 +++ b/plugins/spellchk.c Sun Nov 23 15:32:25 2003 +0000 @@ -107,7 +107,7 @@ buf = g_build_filename(gaim_user_dir(), "dict", NULL); g_file_get_contents(buf, &ibuf, &size, NULL); - free(buf); + g_free(buf); if(!ibuf) { ibuf = g_strdup(defaultconf); size = strlen(defaultconf); @@ -133,7 +133,7 @@ } } } - free(ibuf); + g_free(ibuf); } diff -r 7b9630667f43 -r 08c9d0dcf906 src/conversation.c --- a/src/conversation.c Sun Nov 23 15:25:04 2003 +0000 +++ b/src/conversation.c Sun Nov 23 15:32:25 2003 +0000 @@ -1795,8 +1795,8 @@ { g_return_if_fail(chat != NULL); - if (chat->who != NULL) free(chat->who); - if (chat->topic != NULL) free(chat->topic); + if (chat->who != NULL) g_free(chat->who); + if (chat->topic != NULL) g_free(chat->topic); chat->who = (who == NULL ? NULL : g_strdup(who)); chat->topic = (topic == NULL ? NULL : g_strdup(topic)); diff -r 7b9630667f43 -r 08c9d0dcf906 src/protocols/toc/toc.c --- a/src/protocols/toc/toc.c Sun Nov 23 15:25:04 2003 +0000 +++ b/src/protocols/toc/toc.c Sun Nov 23 15:32:25 2003 +0000 @@ -309,7 +309,7 @@ } /* Allocate a string */ - ret = (char *)malloc((j+1) * sizeof(char)); + ret = (char *)g_malloc((j+1) * sizeof(char)); /* Copy the string */ for (i=0, j=0; msg[i]; i++) @@ -436,7 +436,7 @@ ret = toc_write(tdt->toc_fd, obuf, slen); free(obuf); - free(escaped); + g_free(escaped); return ret; } diff -r 7b9630667f43 -r 08c9d0dcf906 src/protocols/trepia/trepia.c --- a/src/protocols/trepia/trepia.c Sun Nov 23 15:25:04 2003 +0000 +++ b/src/protocols/trepia/trepia.c Sun Nov 23 15:32:25 2003 +0000 @@ -592,7 +592,7 @@ if (*buffer != '\0') g_hash_table_insert(data->keys, data->tag, buffer); else - free(buffer); + g_free(buffer); } data->tag = NULL; diff -r 7b9630667f43 -r 08c9d0dcf906 src/win32/win32dep.c --- a/src/win32/win32dep.c Sun Nov 23 15:25:04 2003 +0000 +++ b/src/win32/win32dep.c Sun Nov 23 15:32:25 2003 +0000 @@ -359,18 +359,18 @@ if( hmod == 0 ) { buf = g_win32_error_message( GetLastError() ); gaim_debug(GAIM_DEBUG_ERROR, "wgaim", "GetModuleHandle error: %s\n", buf); - free(buf); + g_free(buf); return NULL; } if(GetModuleFileName( hmod, (char*)&install_dir, MAXPATHLEN ) == 0) { buf = g_win32_error_message( GetLastError() ); gaim_debug(GAIM_DEBUG_ERROR, "wgaim", "GetModuleFileName error: %s\n", buf); - free(buf); + g_free(buf); return NULL; } buf = g_path_get_dirname( install_dir ); strcpy( (char*)&install_dir, buf ); - free( buf ); + g_free( buf ); return (char*)&install_dir; }