about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2013-08-03 14:27:07 +0300
committerDmitry Podgorny <pasis.ua@gmail.com>2013-08-03 14:27:07 +0300
commit0346fda0b3ddc484c3a28d88a5c42b890feb3079 (patch)
tree4ffaa3d1ad7a20fe1c44e3509b060619e7d8ff2d /src/ui
parent6f498d1f69098742acc33d429c5e8dcee4edd86d (diff)
downloadprofani-tty-0346fda0b3ddc484c3a28d88a5c42b890feb3079.tar.gz
most FREE_SET_NULL replaced with free
FREE_SET_NULL makes extra assignment of NULL for pointers in stack or
dynamic memory that is going to be freed.
FREE_SET_NULL is useful for pointers that can be used in future.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c2
-rw-r--r--src/ui/core.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 50d2b649..6efc1cf1 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -784,7 +784,7 @@ cons_show_room_invite(const char * const invitor, const char * const room,
         notify_invite(display_from, room, reason);
     }
 
-    FREE_SET_NULL(display_from);
+    free(display_from);
 
     ui_console_dirty();
     cons_alert();
diff --git a/src/ui/core.c b/src/ui/core.c
index 126fe127..6b0b2d8d 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -293,8 +293,9 @@ ui_incoming_msg(const char * const from, const char * const message,
     GTimeVal *tv_stamp, gboolean priv)
 {
     gboolean win_created = FALSE;
-    char *display_from;
+    char *display_from = NULL;
     win_type_t win_type;
+
     if (priv) {
         win_type = WIN_PRIVATE;
         display_from = get_nick_from_full_jid(from);
@@ -436,7 +437,7 @@ ui_incoming_msg(const char * const from, const char * const message,
     if (prefs_get_boolean(PREF_NOTIFY_MESSAGE))
         notify_message(display_from, ui_index);
 
-    FREE_SET_NULL(display_from);
+    free(display_from);
 }
 
 void