[CTRACER_LIB]: Check if the object is NULL in ctracer__method_hook

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-11-12 13:20:46 -02:00
parent 94227c57a8
commit 320607ff19
1 changed files with 12 additions and 10 deletions

View File

@ -53,17 +53,19 @@ void ctracer__method_hook(const unsigned long long now,
const unsigned long long function_id,
const void *object, const int state_len)
{
void *t = relay_reserve(ctracer__rchan,
sizeof(struct trace_entry) + state_len);
if (object != NULL) {
void *t = relay_reserve(ctracer__rchan,
sizeof(struct trace_entry) + state_len);
if (t != NULL) {
struct trace_entry *entry = t;
entry->nsec = now;
entry->probe_type = probe_type;
entry->object = object;
entry->function_id = function_id;
ctracer__class_state(object, t + sizeof(*entry));
if (t != NULL) {
struct trace_entry *entry = t;
entry->nsec = now;
entry->probe_type = probe_type;
entry->object = object;
entry->function_id = function_id;
ctracer__class_state(object, t + sizeof(*entry));
}
}
}