summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2007-03-20 20:19:29 +0000
committerhunt <hunt>2007-03-20 20:19:29 +0000
commita39e781f2dcd56e155b0612cb1e045bb485c5c23 (patch)
tree1e75e8d9c669f50628a5a209a3aa6b284873bc15
parente2aab9d6fda09124155685b35c827cdd557fec01 (diff)
downloadsystemtap-steved-a39e781f2dcd56e155b0612cb1e045bb485c5c23.tar.gz
systemtap-steved-a39e781f2dcd56e155b0612cb1e045bb485c5c23.tar.xz
systemtap-steved-a39e781f2dcd56e155b0612cb1e045bb485c5c23.zip
2007-03-20 Martin Hunt <hunt@redhat.com>
* symbols.c (_stp_alloc_module): Fix up error cleanup when malloc fails.
-rw-r--r--runtime/transport/ChangeLog5
-rw-r--r--runtime/transport/symbols.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog
index f9dca7f2..dcee1d79 100644
--- a/runtime/transport/ChangeLog
+++ b/runtime/transport/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-20 Martin Hunt <hunt@redhat.com>
+
+ * symbols.c (_stp_alloc_module): Fix up error
+ cleanup when malloc fails.
+
2007-03-14 Martin Hunt <hunt@redhat.com>
* transport_msgs.h: ifdef old messages as such.
diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
index 72070c7d..9d5163d0 100644
--- a/runtime/transport/symbols.c
+++ b/runtime/transport/symbols.c
@@ -86,12 +86,13 @@ static struct _stp_module * _stp_alloc_module(unsigned num, unsigned datasize)
return mod;
bad:
- if (mod)
- kfree(mod);
- if (mod->allocated && mod->symbols)
- vfree(mod->symbols);
- else
- kfree(mod->symbols);
+ if (mod) {
+ if (mod->allocated && mod->symbols)
+ vfree(mod->symbols);
+ else
+ kfree(mod->symbols);
+ kfree(mod);
+ }
return NULL;
}