diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-10-04 16:26:34 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-10-05 10:35:21 +0000 |
| commit | 95e00bdf7075329277cac97a6fd0a929c9a8e453 (patch) | |
| tree | ff4521ff8f759eec5aac329efbf00bbca68f0d70 /src/live_effects | |
| parent | Fix segfault with bad SVG file. (diff) | |
| download | inkscape-95e00bdf7075329277cac97a6fd0a929c9a8e453.tar.gz inkscape-95e00bdf7075329277cac97a6fd0a929c9a8e453.zip | |
Fix some memory leaks found by scan-build
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-offset.cpp | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-powerclip.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-powerstroke-interpolators.h | 1 | ||||
| -rw-r--r-- | src/live_effects/parameter/fontbutton.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index f9c083d39..57b793993 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -531,7 +531,7 @@ LPECopyRotate::doEffect_path (Geom::PathVector const & path_in) } Geom::PathVector triangle; triangle.push_back(divider); - Geom::PathIntersectionGraph *pig = new Geom::PathIntersectionGraph(triangle, path_out); + std::unique_ptr<Geom::PathIntersectionGraph> pig(new Geom::PathIntersectionGraph(triangle, path_out)); if (pig && !path_out.empty() && !triangle.empty()) { path_out = pig->getIntersection(); } diff --git a/src/live_effects/lpe-offset.cpp b/src/live_effects/lpe-offset.cpp index 401875700..72d29d0c1 100644 --- a/src/live_effects/lpe-offset.cpp +++ b/src/live_effects/lpe-offset.cpp @@ -294,7 +294,6 @@ LPEOffset::doEffect_path(Geom::PathVector const & path_in) Geom::PathVector ret; Geom::PathVector open_ret; Geom::PathVector ret_outline; - Geom::PathIntersectionGraph *pig; for (Geom::PathVector::const_iterator path_it = filled_rule_pathv.begin(); path_it != filled_rule_pathv.end(); ++path_it) { Geom::Path original = (*path_it); if (original.empty()) { @@ -430,7 +429,7 @@ LPEOffset::doEffect_path(Geom::PathVector const & path_in) if (offset < 0) { sp_flatten(ret_outline, fill_nonZero); - pig = new Geom::PathIntersectionGraph(ret, ret_outline); + std::unique_ptr<Geom::PathIntersectionGraph> pig(new Geom::PathIntersectionGraph(ret, ret_outline)); if (pig && !ret_outline.empty() && !ret.empty()) { ret = pig->getAminusB(); } diff --git a/src/live_effects/lpe-powerclip.cpp b/src/live_effects/lpe-powerclip.cpp index 461a22125..cb444149c 100644 --- a/src/live_effects/lpe-powerclip.cpp +++ b/src/live_effects/lpe-powerclip.cpp @@ -306,7 +306,7 @@ LPEPowerClip::doEffect_path(Geom::PathVector const & path_in){ if (c) { Geom::PathVector c_pv = c->get_pathvector(); c_pv *= sp_item_transform_repr (sp_lpe_item).inverse(); - Geom::PathIntersectionGraph *pig = new Geom::PathIntersectionGraph(c_pv, path_out); + std::unique_ptr<Geom::PathIntersectionGraph> pig(new Geom::PathIntersectionGraph(c_pv, path_out)); if (pig && !c_pv.empty() && !path_in.empty()) { path_out = pig->getIntersection(); } @@ -348,7 +348,7 @@ LPEPowerClip::flattenClip(SPItem * clip_data, Geom::PathVector &path_in) if (c) { Geom::PathVector c_pv = c->get_pathvector(); c_pv *= sp_item_transform_repr (sp_lpe_item).inverse(); - Geom::PathIntersectionGraph *pig = new Geom::PathIntersectionGraph(c_pv, path_in); + std::unique_ptr<Geom::PathIntersectionGraph> pig(new Geom::PathIntersectionGraph(c_pv, path_in)); if (pig && !c_pv.empty() && !path_in.empty()) { path_in = pig->getIntersection(); } diff --git a/src/live_effects/lpe-powerstroke-interpolators.h b/src/live_effects/lpe-powerstroke-interpolators.h index 4828a0bbb..65bee9a63 100644 --- a/src/live_effects/lpe-powerstroke-interpolators.h +++ b/src/live_effects/lpe-powerstroke-interpolators.h @@ -199,6 +199,7 @@ public: Spiro::spiro_run(controlpoints, len, fit); fit *= Scale(1,scale_y); + delete controlpoints; return fit; }; diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp index 07bc5d6ab..038a58fc6 100644 --- a/src/live_effects/parameter/fontbutton.cpp +++ b/src/live_effects/parameter/fontbutton.cpp @@ -38,7 +38,7 @@ FontButtonParam::param_set_default() void FontButtonParam::param_update_default(const gchar * default_value) { - defvalue = (Glib::ustring)strdup(default_value); + defvalue = Glib::ustring(default_value); } bool |
