lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [1/2] git commit: refs/heads/cfc-pod - Better fix for double-free in CFCPerlClass
Date Tue, 30 Jul 2013 10:02:25 GMT
Updated Branches:
  refs/heads/cfc-pod 82fa89370 -> 58f9153df


Better fix for double-free in CFCPerlClass


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/31524da4
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/31524da4
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/31524da4

Branch: refs/heads/cfc-pod
Commit: 31524da43bd565a7391b94b84b5a64e67eac528b
Parents: 82fa893
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Tue Jul 30 11:38:53 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Tue Jul 30 11:38:53 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCPerlClass.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/31524da4/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index a3c8670..6e9d48b 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -75,7 +75,8 @@ CFCPerlClass_init(CFCPerlClass *self, CFCParcel *parcel,
     self->parcel = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
     self->class_name = CFCUtil_strdup(class_name);
     // Client may be NULL, since fetch_singleton() does not always succeed.
-    self->client = CFCClass_fetch_singleton(parcel, class_name); 
+    CFCClass *client = CFCClass_fetch_singleton(parcel, class_name);
+    self->client = (CFCClass*)CFCBase_incref((CFCBase*)client);
     self->pod_spec          = NULL;
     self->xs_code           = NULL;
     self->cons_aliases      = NULL;
@@ -90,6 +91,7 @@ CFCPerlClass_init(CFCPerlClass *self, CFCParcel *parcel,
 void
 CFCPerlClass_destroy(CFCPerlClass *self) {
     CFCBase_decref((CFCBase*)self->parcel);
+    CFCBase_decref((CFCBase*)self->client);
     CFCBase_decref((CFCBase*)self->pod_spec);
     FREEMEM(self->class_name);
     FREEMEM(self->xs_code);


Mime
View raw message