From 2116a87c0c2d27ac52db07f31c7aac2b19bbacba Mon Sep 17 00:00:00 2001 From: r0nk Date: Sun, 1 Feb 2015 19:28:20 -0500 Subject: [PATCH] fixed a _huge_ memory leak. --- libr/bin/bin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libr/bin/bin.c b/libr/bin/bin.c index 07e3495d5a..d0d8e54170 100644 --- a/libr/bin/bin.c +++ b/libr/bin/bin.c @@ -599,6 +599,8 @@ eprintf ("Asuming filepath %s\n", filepath); binfile->o->baddr = baseaddr; } + free (buf_bytes); + if (binfile) return r_bin_file_set_cur_binfile (bin, binfile); return R_FALSE; } @@ -854,6 +856,7 @@ static RBinObject * r_bin_object_new (RBinFile *binfile, RBinPlugin *plugin, ut6 if (!o->bin_obj) { eprintf("Error in r_bin_object_new: load_bytes failed for %s plugin\n", plugin->name); + sdb_free(o->kv); free (o); return NULL; } @@ -870,6 +873,7 @@ static RBinObject * r_bin_object_new (RBinFile *binfile, RBinPlugin *plugin, ut6 } else binfile->o = old_o; o->obj_size = sz; } else { + sdb_free(o->kv); free (o); return NULL; }