Skip to content

Commit

Permalink
Merge pull request #1532 from greenbone/mergify/bp/gvmd-20.08/pr-1530
Browse files Browse the repository at this point in the history
Fix erroneous freeing of ical timezone component (backport #1530)
  • Loading branch information
timopollmeier authored May 25, 2021
2 parents b7d379c + 82e74e3 commit 098da93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix "not regexp ..." filters [#1482](https://github.com/greenbone/gvmd/pull/1482)
- Escape TLS certificate DNs that are invalid UTF-8 [#1486](https://github.com/greenbone/gvmd/pull/1486)
- Free alert get data in report_content_for_alert [#1526](https://github.com/greenbone/gvmd/pull/1526)
- Fix erroneous freeing of ical timezone component [#1530](https://github.com/greenbone/gvmd/pull/1530)

### Removed

Expand Down
6 changes: 4 additions & 2 deletions src/manage_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ icalcomponent *
icalendar_from_string (const char *ical_string, icaltimezone *zone,
gchar **error)
{
icalcomponent *ical_new, *ical_parsed;
icalcomponent *ical_new, *ical_parsed, *timezone_component;
icalproperty *error_prop;
GString *warnings_buffer;
int vevent_count = 0;
Expand Down Expand Up @@ -754,7 +754,9 @@ icalendar_from_string (const char *ical_string, icaltimezone *zone,
icalcomponent_add_property (ical_new,
icalproperty_new_prodid (GVM_PRODID));

icalcomponent_add_component (ical_new, icaltimezone_get_component (zone));
timezone_component
= icalcomponent_new_clone (icaltimezone_get_component (zone));
icalcomponent_add_component (ical_new, timezone_component);

switch (icalcomponent_isa (ical_parsed))
{
Expand Down

0 comments on commit 098da93

Please sign in to comment.