From: Ben Pfaff Date: Sun, 24 Jan 2021 05:01:55 +0000 (-0800) Subject: output-item: Allocate correct size in message_item_create(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d920d53d4a2ccc2f02e62d73afc0d1a6e1de9c6;p=pspp output-item: Allocate correct size in message_item_create(). --- diff --git a/src/output/output-item.c b/src/output/output-item.c index c39e8cd326..9febcfabd5 100644 --- a/src/output/output-item.c +++ b/src/output/output-item.c @@ -305,7 +305,7 @@ image_item_create (cairo_surface_t *image) struct output_item * message_item_create (const struct msg *msg) { - struct output_item *item = xmalloc (sizeof *msg); + struct output_item *item = xmalloc (sizeof *item); *item = (struct output_item) { OUTPUT_ITEM_INITIALIZER (OUTPUT_ITEM_MESSAGE), .message = msg_dup (msg),