summaryrefslogtreecommitdiff
path: root/src/analysis/binaries/file.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-07-24 18:43:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-07-24 18:43:55 (GMT)
commit156d2e2f6beda2302552ac79678494d914fda05b (patch)
tree021825960b7ac3315a336fc085a4f1d07c05df39 /src/analysis/binaries/file.c
parent21537636cd8318cf5a720211619ad3c3023b52e9 (diff)
Replaced all remaining raw accesses to binary contents with the GBinContent wrapper in binary formats.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@555 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/binaries/file.c')
-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;
}