summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhransu Mohanty <smohantty@gmail.com>2020-06-01 18:53:36 +0900
committerHermet Park <chuneon.park@samsung.com>2020-06-01 18:53:36 +0900
commit161e411d183f0b2d5c19a3a99b5e91e2246f5541 (patch)
tree704051c1f2a6530ad3f32de9891ce6bd280c1335
parentb981667d52b721fcde217abd8497ef2feba65690 (diff)
svg/loader: Fix memory leak
Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11908
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c5
-rw-r--r--src/static_libs/vg_common/vg_common_svg.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index 313d3eed15..9151e05c15 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -2410,6 +2410,7 @@ static Eina_Bool
2410evas_vg_load_file_close_svg(Vg_File_Data *vfd) 2410evas_vg_load_file_close_svg(Vg_File_Data *vfd)
2411{ 2411{
2412 if (vfd->root) efl_unref(vfd->root); 2412 if (vfd->root) efl_unref(vfd->root);
2413 free(vfd);
2413 return EINA_TRUE; 2414 return EINA_TRUE;
2414} 2415}
2415 2416
@@ -2462,7 +2463,9 @@ evas_vg_load_file_open_svg(Eina_File *file,
2462 } 2463 }
2463 free(loader.svg_parse); 2464 free(loader.svg_parse);
2464 2465
2465 return vg_common_svg_create_vg_node(loader.doc); 2466 Vg_File_Data* result = vg_common_svg_create_vg_node(loader.doc);
2467 vg_common_svg_node_free(loader.doc);
2468 return result;
2466} 2469}
2467 2470
2468static Evas_Vg_Load_Func evas_vg_load_svg_func = 2471static Evas_Vg_Load_Func evas_vg_load_svg_func =
diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c
index de5477bb0e..058cdf99e0 100644
--- a/src/static_libs/vg_common/vg_common_svg.c
+++ b/src/static_libs/vg_common/vg_common_svg.c
@@ -536,12 +536,14 @@ vg_common_svg_node_free(Svg_Node *node)
536 { 536 {
537 _svg_style_gradient_free(grad); 537 _svg_style_gradient_free(grad);
538 } 538 }
539 case SVG_NODE_CUSTOME_COMMAND:
540 if (node->node.command.commands) free(node->node.command.commands);
541 if (node->node.command.points) free(node->node.command.points);
539 break; 542 break;
540 default: 543 default:
541 break; 544 break;
542 } 545 }
543 if (node->node.command.commands_count > 0) free(node->node.command.commands); 546
544 if (node->node.command.points_count > 0) free(node->node.command.points);
545 free(node); 547 free(node);
546} 548}
547 549