projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: object-pool.c: dereferenced before null check
[babeltrace.git]
/
src
/
lib
/
object-pool.c
diff --git
a/src/lib/object-pool.c
b/src/lib/object-pool.c
index 8d95a890bbda66dd7da0ab497be3cc7a527f2e00..b31807434236acc32ccdb4f6733f2aa98c507592 100644
(file)
--- a/
src/lib/object-pool.c
+++ b/
src/lib/object-pool.c
@@
-35,6
+35,7
@@
int bt_object_pool_initialize(struct bt_object_pool *pool,
{
int ret = 0;
{
int ret = 0;
+ BT_ASSERT(pool);
BT_ASSERT(new_object_func);
BT_ASSERT(destroy_object_func);
BT_LOGD("Initializing object pool: addr=%p, data-addr=%p",
BT_ASSERT(new_object_func);
BT_ASSERT(destroy_object_func);
BT_LOGD("Initializing object pool: addr=%p, data-addr=%p",
@@
-53,10
+54,7
@@
int bt_object_pool_initialize(struct bt_object_pool *pool,
goto end;
error:
goto end;
error:
- if (pool) {
- bt_object_pool_finalize(pool);
- }
-
+ bt_object_pool_finalize(pool);
ret = -1;
end:
ret = -1;
end:
This page took
0.023828 seconds
and
4
git commands to generate.