summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-18 18:25:13 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-18 18:25:13 +0000
commit97b9420e91e83043b4640b25732241e75d80dfee (patch)
tree1075495007f296c76a768651067a6803909f2f68 /src
parentfdbfb01d85f49717c3b8928d97bc16c4e7b860d7 (diff)
use g_free in bencode.c for memory profiling
Diffstat (limited to 'src')
-rw-r--r--src/bencode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bencode.c b/src/bencode.c
index 5f9c030..3eacebb 100644
--- a/src/bencode.c
+++ b/src/bencode.c
@@ -183,7 +183,7 @@ be_node *be_decode(const char *data)
static inline void _be_free_str(char *str)
{
if (str)
- free(str - sizeof(gint64));
+ g_free(str - sizeof(gint64));
}
int be_validate_node(be_node * node, int type)
@@ -208,7 +208,7 @@ void be_free(be_node * node)
unsigned int i;
for (i = 0; node->val.l[i]; ++i)
be_free(node->val.l[i]);
- free(node->val.l);
+ g_free(node->val.l);
break;
}
@@ -218,11 +218,11 @@ void be_free(be_node * node)
_be_free_str(node->val.d[i].key);
be_free(node->val.d[i].val);
}
- free(node->val.d);
+ g_free(node->val.d);
break;
}
}
- free(node);
+ g_free(node);
}
be_node *be_dict_find(be_node * node, char *key, int type)