From 72f82d096c05dc97b26f9ca30093343161dc4444 Mon Sep 17 00:00:00 2001 From: TingPing Date: Thu, 11 Dec 2014 09:57:11 -0500 Subject: Fix some warnings in xsys - Remove unused code - Fix leak --- plugins/sysinfo/xsys.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/sysinfo/xsys.c') diff --git a/plugins/sysinfo/xsys.c b/plugins/sysinfo/xsys.c index 79abcea1..17c25616 100644 --- a/plugins/sysinfo/xsys.c +++ b/plugins/sysinfo/xsys.c @@ -86,6 +86,7 @@ print_summary (int announce, char* format) char os_host[bsize]; char os_user[bsize]; char os_kernel[bsize]; + char *free_space; unsigned long long mem_total; unsigned long long mem_free; unsigned int count; @@ -158,7 +159,9 @@ print_summary (int announce, char* format) return HEXCHAT_EAT_ALL; } - snprintf (buffer, bsize, "%s", pretty_freespace ("Physical", &mem_free, &mem_total)); + free_space = pretty_freespace ("Physical", &mem_free, &mem_total); + snprintf (buffer, bsize, "%s", free_space); + free (free_space); format_output ("RAM", buffer, format); strcat (sysinfo, "\017 "); strncat (sysinfo, buffer, bsize - strlen (sysinfo)); -- cgit 1.4.1