Add error check for zmalloc
authorJP Ikaheimonen <jp_ikaheimonen@mentor.com>
Thu, 14 Nov 2013 08:24:33 +0000 (10:24 +0200)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 14 Nov 2013 20:05:52 +0000 (15:05 -0500)
Report if zmalloc fails in shadow_copy_event.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index d8adccde214925f2f9cd68d20ef65dadc3617951..4912ca6c6193f0b01bb1363cd04e3e0f8d7d910b 100644 (file)
@@ -1480,8 +1480,11 @@ static void shadow_copy_event(struct ust_app_event *ua_event,
                exclusion_alloc_size = sizeof(struct lttng_ust_event_exclusion) +
                                LTTNG_UST_SYM_NAME_LEN * uevent->exclusion->count;
                ua_event->exclusion = zmalloc(exclusion_alloc_size);
-               if (ua_event->exclusion) {
-                       memcpy(ua_event->exclusion, uevent->exclusion, exclusion_alloc_size);
+               if (ua_event->exclusion == NULL) {
+                       PERROR("malloc");
+               } else {
+                       memcpy(ua_event->exclusion, uevent->exclusion,
+                                       exclusion_alloc_size);
                }
        }
 }
This page took 0.035667 seconds and 4 git commands to generate.