From 3f855f07f5d2e9a08a586436719358c40a46f29d Mon Sep 17 00:00:00 2001 From: TingPing Date: Sun, 28 Dec 2014 06:08:20 -0500 Subject: Use glib for allocations in all plugins Continuation of 83032b1aa --- plugins/doat/doat.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'plugins/doat/doat.c') diff --git a/plugins/doat/doat.c b/plugins/doat/doat.c index 5e0aa4eb..1d1bfcdf 100644 --- a/plugins/doat/doat.c +++ b/plugins/doat/doat.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "hexchat-plugin.h" static hexchat_plugin *ph; @@ -33,7 +34,7 @@ parse_command( char *word[], char *word_eol[], void *userdata ) { break; } - channel = strdup( token ); + channel = g_strdup( token ); delimiter = strchr( channel, '/' ); @@ -42,13 +43,13 @@ parse_command( char *word[], char *word_eol[], void *userdata ) { *delimiter = '\0'; if( strlen( delimiter + 1 ) > 0 ) { - server = strdup( delimiter + 1 ); + server = g_strdup( delimiter + 1 ); } } /* /Network form */ if( strlen( channel ) == 0 ) { - free( channel ); + g_free( channel ); channel = NULL; } @@ -60,13 +61,8 @@ parse_command( char *word[], char *word_eol[], void *userdata ) { } } - if( channel != NULL ) { - free( channel ); - } - - if( server != NULL ) { - free( server ); - } + g_free( channel ); + g_free( server ); } } return HEXCHAT_EAT_HEXCHAT; -- cgit 1.4.1