summary refs log tree commit diff stats
path: root/plugins/doat/doat.c
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-12-28 06:08:20 -0500
committerTingPing <tingping@tingping.se>2014-12-28 06:47:07 -0500
commit3f855f07f5d2e9a08a586436719358c40a46f29d (patch)
tree12ffd1b49265e33c10149632a4cd17afb7fe994a /plugins/doat/doat.c
parent83032b1aa3c3e5910c5cfd3e0ea1d25827f56475 (diff)
Use glib for allocations in all plugins
Continuation of 83032b1aa
Diffstat (limited to 'plugins/doat/doat.c')
-rw-r--r--plugins/doat/doat.c16
1 files changed, 6 insertions, 10 deletions
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 <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <glib.h>
 #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;