diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-24 09:43:25 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-12-24 09:43:25 +0100 |
commit | 30d2ebddd6eb1fd62deff137aa2c8eab55f2efc3 (patch) | |
tree | 038e7af8e79c5c9321c09dfc7d560141b2305118 /openbsc/src | |
parent | 09f7ad0ff7961b713264629dae790db9453c8116 (diff) |
move msgb talloc context into talloc_ctx.c
This keeps the ordering right, independent of link ordering, it
will ensure that the talloc dump will also catch msgb related
memory leaks.
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/msgb.c | 7 | ||||
-rw-r--r-- | openbsc/src/talloc_ctx.c | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/openbsc/src/msgb.c b/openbsc/src/msgb.c index 48a5a7b03..9f2fcfa96 100644 --- a/openbsc/src/msgb.c +++ b/openbsc/src/msgb.c @@ -28,7 +28,7 @@ #include <openbsc/talloc.h> #include <openbsc/debug.h> -static void *tall_msgb_ctx; +void *tall_msgb_ctx; struct msgb *msgb_alloc(u_int16_t size, const char *name) { @@ -96,8 +96,3 @@ void msgb_reset(struct msgb *msg) msg->l3h = NULL; msg->smsh = NULL; } - -static __attribute__((constructor)) void on_dso_load_trau_msgb(void) -{ - tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 1, "msgb"); -} diff --git a/openbsc/src/talloc_ctx.c b/openbsc/src/talloc_ctx.c index aa9f0b4d7..e90677b7e 100644 --- a/openbsc/src/talloc_ctx.c +++ b/openbsc/src/talloc_ctx.c @@ -1,6 +1,7 @@ #include <openbsc/talloc.h> #include <openbsc/gsm_data.h> +extern void *tall_msgb_ctx; extern void *tall_fle_ctx; extern void *tall_locop_ctx; extern void *tall_gsms_ctx; @@ -16,6 +17,7 @@ extern void *tall_upq_ctx; void talloc_ctx_init(void) { + tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 0, "bs11_file_list_entry"); tall_locop_ctx = talloc_named_const(tall_bsc_ctx, 0, "loc_updating_oper"); |