summaryrefslogtreecommitdiff
path: root/src/analysis/binaries
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/binaries')
-rw-r--r--src/analysis/binaries/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/analysis/binaries/file.c b/src/analysis/binaries/file.c
index d49ecb4..c946572 100644
--- a/src/analysis/binaries/file.c
+++ b/src/analysis/binaries/file.c
@@ -173,11 +173,6 @@ GLoadedBinary *g_file_binary_new_from_file(const char *filename)
content = g_binary_content_new_from_file(filename);
if (content == NULL) goto lbf_error;
- /////
- loaded->bin_data = g_binary_content_get(content, &loaded->bin_length);
- ///////
-
-
target = find_matching_format(content);
desc = get_binary_format_name(target);
@@ -194,6 +189,7 @@ GLoadedBinary *g_file_binary_new_from_file(const char *filename)
if (loaded->format == NULL)
{
+ g_object_unref(G_OBJECT(content));
log_simple_message(LMT_ERROR, _("Error while loading the binary"));
goto lbf_error;
}
@@ -203,6 +199,7 @@ GLoadedBinary *g_file_binary_new_from_file(const char *filename)
if (desc == NULL)
{
+ g_object_unref(G_OBJECT(loaded->format));
log_simple_message(LMT_INFO, _("Unknown architecture"));
goto lbf_error;
}
@@ -213,6 +210,7 @@ GLoadedBinary *g_file_binary_new_from_file(const char *filename)
if (loaded->proc == NULL)
{
+ g_object_unref(G_OBJECT(loaded->format));
log_simple_message(LMT_ERROR, _("Unable to load the required processor"));
goto lbf_error;
}