mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-19 14:58:35 +03:00
OSMO_ASSERT() on double-free or invalid pointer
Change-Id: I2ab8fb7b86b6f608bbd9c4f79369c64cbad88bdf
This commit is contained in:
@@ -66,6 +66,7 @@ int _talloc_free(void *ptr, const char *location)
|
|||||||
if (ptr == msgb_data[i]) {
|
if (ptr == msgb_data[i]) {
|
||||||
if (!msgb_inuse[i]) {
|
if (!msgb_inuse[i]) {
|
||||||
TRACE_ERROR("%s: double_free by %s\r\n", __func__, location);
|
TRACE_ERROR("%s: double_free by %s\r\n", __func__, location);
|
||||||
|
OSMO_ASSERT(0);
|
||||||
} else {
|
} else {
|
||||||
msgb_inuse[i] = 0;
|
msgb_inuse[i] = 0;
|
||||||
}
|
}
|
||||||
@@ -76,6 +77,7 @@ int _talloc_free(void *ptr, const char *location)
|
|||||||
|
|
||||||
local_irq_restore(x);
|
local_irq_restore(x);
|
||||||
TRACE_ERROR("%s: invalid pointer %p from %s\r\n", __func__, ptr, location);
|
TRACE_ERROR("%s: invalid pointer %p from %s\r\n", __func__, ptr, location);
|
||||||
|
OSMO_ASSERT(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user