summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-12-18 23:26:56 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-12-18 23:26:56 (GMT)
commitcf9ea46a796000f0252bb7d80c0ac0fb170e156a (patch)
tree4fdab700f2d0fe0e88cf21063e9da516a4f5d5b0 /src/analysis
parentf4dbbab3190d13e61f125eea51a0ecec2ab9e897 (diff)
Fixed a bug when the binary loading fails.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@306 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/binaries/file.c8
-rw-r--r--src/analysis/binary.c22
2 files changed, 7 insertions, 23 deletions
diff --git a/src/analysis/binaries/file.c b/src/analysis/binaries/file.c
index 46307fb..9c43ed5 100644
--- a/src/analysis/binaries/file.c
+++ b/src/analysis/binaries/file.c
@@ -133,15 +133,9 @@ static void g_file_binary_init(GFileBinary *binary)
static void g_file_binary_finalize(GFileBinary *binary)
{
- gpointer obj_class; /* Classe parente */
-
free(binary->filename);
- /* On passe le relai */
-
- obj_class = g_type_class_peek_parent(G_FILE_BINARY_GET_CLASS(binary));
-
- G_OBJECT_CLASS(obj_class)->finalize(G_OBJECT(binary));
+ G_OBJECT_CLASS(g_file_binary_parent_class)->finalize(G_OBJECT(binary));
}
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index ecf9c79..61f826a 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -146,18 +146,14 @@ static void g_loaded_binary_init(GLoadedBinary *binary)
static void g_loaded_binary_dispose(GLoadedBinary *binary)
{
- gpointer obj_class; /* Classe parente */
-
- g_object_unref(G_OBJECT(binary->format));
- g_object_unref(G_OBJECT(binary->proc));
+ if (binary->format != NULL)
+ g_object_unref(G_OBJECT(binary->format));
+ if (binary->proc != NULL)
+ g_object_unref(G_OBJECT(binary->proc));
/* TODO... */
- /* On passe le relai */
-
- obj_class = g_type_class_peek_parent(G_FILE_BINARY_GET_CLASS(binary));
-
- G_OBJECT_CLASS(obj_class)->dispose(G_OBJECT(binary));
+ G_OBJECT_CLASS(g_loaded_binary_parent_class)->dispose(G_OBJECT(binary));
}
@@ -176,15 +172,9 @@ static void g_loaded_binary_dispose(GLoadedBinary *binary)
static void g_loaded_binary_finalize(GLoadedBinary *binary)
{
- gpointer obj_class; /* Classe parente */
-
/* TODO */
- /* On passe le relai */
-
- obj_class = g_type_class_peek_parent(G_FILE_BINARY_GET_CLASS(binary));
-
- G_OBJECT_CLASS(obj_class)->finalize(G_OBJECT(binary));
+ G_OBJECT_CLASS(g_loaded_binary_parent_class)->finalize(G_OBJECT(binary));
}