projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5b07bb
)
message-item: Fix reference counting in message_item_to_text_item().
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 27 Dec 2020 04:24:53 +0000
(20:24 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 27 Dec 2020 04:24:53 +0000
(20:24 -0800)
This function should take ownership of the message_item passed in, but it
leaked a reference to it.
src/output/message-item.c
patch
|
blob
|
history
diff --git
a/src/output/message-item.c
b/src/output/message-item.c
index c60d166779969f8428b1a568a58a0224699b5e7a..ddfcc3f42ee33d26099d4121f8fd5c6fe856f756 100644
(file)
--- a/
src/output/message-item.c
+++ b/
src/output/message-item.c
@@
-48,8
+48,10
@@
message_item_get_msg (const struct message_item *item)
struct text_item *
message_item_to_text_item (struct message_item *message_item)
{
-
return
text_item_create_nocopy (
+
struct text_item *text_item =
text_item_create_nocopy (
TEXT_ITEM_LOG, msg_to_string (message_item_get_msg (message_item)));
+ message_item_unref (message_item);
+ return text_item;
}
static void