summary refs log tree commit diff stats
path: root/plugins/doat/doat.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/doat/doat.c')
-rw-r--r--plugins/doat/doat.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/doat/doat.c b/plugins/doat/doat.c
index 194be1a3..1d1bfcdf 100644
--- a/plugins/doat/doat.c
+++ b/plugins/doat/doat.c
@@ -5,9 +5,12 @@
  * http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING
  * for more details. */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <glib.h>
 #include "hexchat-plugin.h"
 
 static hexchat_plugin *ph;
@@ -31,7 +34,7 @@ parse_command( char *word[], char *word_eol[], void *userdata ) {
 				break;
 			}
 
-			channel = strdup( token );
+			channel = g_strdup( token );
 				
 			delimiter = strchr( channel, '/' );
 
@@ -40,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;
 			}
 
@@ -58,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;