diff options
author | TingPing <tingping@tingping.se> | 2014-12-11 09:57:11 -0500 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2014-12-11 10:05:05 -0500 |
commit | 72f82d096c05dc97b26f9ca30093343161dc4444 (patch) | |
tree | d81d596e0843823808d8f63c116a789c61965384 /plugins/sysinfo/xsys.c | |
parent | 74ff67acd3a51253c4941bc7322af346d408f47b (diff) |
Fix some warnings in xsys
- Remove unused code - Fix leak
Diffstat (limited to 'plugins/sysinfo/xsys.c')
-rw-r--r-- | plugins/sysinfo/xsys.c | 5 |
1 files changed, 4 insertions, 1 deletions
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)); |