about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Hill <dhill@conformal.com>2013-06-06 15:57:38 -0400
committerDavid Hill <dhill@conformal.com>2013-06-06 15:57:38 -0400
commit1f24f32da3ce70a8b8dfcbcebff3cce51dd207a4 (patch)
tree3b45efb5a4dcc059ec1af8c32e33a31ad5ff9904
parent4f4eccd1273fa42b30611dae5304ba87f9ab7246 (diff)
downloadxombrero-1f24f32da3ce70a8b8dfcbcebff3cce51dd207a4.tar.gz
in xtp_handle_rt, only allocate memory when needed. fixes a small leak.
-rw-r--r--about.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/about.c b/about.c
index d9c1fc0..fdb081a 100644
--- a/about.c
+++ b/about.c
@@ -932,7 +932,6 @@ xtp_handle_rt(struct tab *t, uint8_t cmd, int id, const char *query)
 		for (i = 0; i < get_settings_size(); ++i) {
 			if (!rs[i].activate)
 				continue;
-			sr = g_malloc(sizeof *sr);
 			val = (char *)g_hash_table_lookup(new_settings,
 			    rs[i].name);
 			modify = 0;
@@ -963,6 +962,7 @@ xtp_handle_rt(struct tab *t, uint8_t cmd, int id, const char *query)
 				break;
 			}
 			if (rs[i].activate(val)) {
+				sr = g_malloc(sizeof *sr);
 				sr->name = g_strdup(rs[i].name);
 				sr->value = g_strdup(val);
 				TAILQ_INSERT_TAIL(&srl, sr, entry);