Mercurial > pidgin
changeset 7606:08c9d0dcf906
[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 <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sun, 23 Nov 2003 15:32:25 +0000 |
parents | 7b9630667f43 |
children | 6a9d041e9b1a |
files | plugins/spellchk.c src/conversation.c src/protocols/toc/toc.c src/protocols/trepia/trepia.c src/win32/win32dep.c |
diffstat | 5 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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); }
--- 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));
--- 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; }
--- 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;
--- 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; }