38 lines
1.2 KiB
Diff
38 lines
1.2 KiB
Diff
From 14294634579557fee136128d410211ea53635c5c Mon Sep 17 00:00:00 2001
|
|
From: Allen Winter <winter@kde.org>
|
|
Date: Sun, 2 Jun 2024 11:03:33 -0400
|
|
Subject: [PATCH] icalcomponent.c - fix a memleak in icalcomponent_normalize()
|
|
|
|
Fix a memleak introduced in the previous commit.
|
|
Make sure to return on NULL specified component *before*
|
|
the pvl_lists are created;.
|
|
---
|
|
src/libical/icalcomponent.c | 7 +++++--
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/libical/icalcomponent.c b/src/libical/icalcomponent.c
|
|
index be524767d..9c2db5299 100644
|
|
--- a/src/libical/icalcomponent.c
|
|
+++ b/src/libical/icalcomponent.c
|
|
@@ -2623,15 +2623,18 @@ static int comp_compare(void *a, void *b)
|
|
|
|
void icalcomponent_normalize(icalcomponent *comp)
|
|
{
|
|
- pvl_list sorted_props = pvl_newlist();
|
|
- pvl_list sorted_comps = pvl_newlist();
|
|
icalproperty *prop;
|
|
icalcomponent *sub;
|
|
+ pvl_list sorted_props;
|
|
+ pvl_list sorted_comps;
|
|
|
|
icalerror_check_arg(comp != 0, "comp");
|
|
if (!comp)
|
|
return;
|
|
|
|
+ sorted_props = pvl_newlist();
|
|
+ sorted_comps = pvl_newlist();
|
|
+
|
|
/* Normalize properties into sorted list */
|
|
while ((prop = pvl_pop(comp->properties)) != 0) {
|
|
int nparams, remove = 0;
|