From 58c14eed506038ef5ce732fc0b3522d06ec50f65 Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth@cworth.org>
Date: Sat, 5 Jan 2008 22:01:26 -0800
Subject: [PATCH] Remove gratuitous dynamic memorymanagement

---
 lm-echo.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/lm-echo.c b/lm-echo.c
index a93fb54..1783197 100644
--- a/lm-echo.c
+++ b/lm-echo.c
@@ -34,20 +34,10 @@ typedef struct {
     GMainLoop	*main_loop;
 } msg_data_t;
  
-static void
-free_user_info (UserInfo *info)
-{
-    g_free (info->name);
-    g_free (info->passwd);
- 
-    g_free (info);
-}
- 
 static void
 authentication_cb (LmConnection *connection, gboolean result, gpointer ud)
 {
     g_print ("Auth: %d\n", result);
-    free_user_info ((UserInfo *) ud);
  
     if (result == TRUE) {
 	LmMessage *m;
@@ -140,7 +130,7 @@ main (int argc, char **argv)
     LmConnection     *connection;
     LmMessageHandler *handler;
     gboolean          result;
-    UserInfo         *info;
+    UserInfo          info;
     gchar            *jid;
     msg_data_t	      data;
     GError	     *error;
@@ -167,13 +157,12 @@ main (int argc, char **argv)
                                                                                 
     lm_message_handler_unref (handler);
                                                                                 
-    info = g_new0 (UserInfo, 1);
-    info->name = g_strdup (argv[2]);
-    info->passwd = g_strdup (argv[3]);
+    info.name = argv[2];
+    info.passwd = argv[3];
                                                                                 
     result = lm_connection_open (connection,
 				 (LmResultFunction) connection_open_cb,
-				 info, NULL, NULL);
+				 &info, NULL, NULL);
     if (!result) {
 	g_print ("Opening connection failed: %d\n", result);
 	exit (1);
-- 
2.45.2