summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-08-04 11:06:49 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-08-04 11:06:59 +0200
commit5b1c7249a5bc219f01ebc3e9b9cf64b678039de8 (patch)
treee73263954a446dc502bf8758cfc9844098e955f2 /src/drivers
parent81941c5597f0fd5310036312efd9112922f3c164 (diff)
Remove memory leak.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/SVG/Fl_SVG_File_Surface.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/SVG/Fl_SVG_File_Surface.cxx b/src/drivers/SVG/Fl_SVG_File_Surface.cxx
index 5106c6486..8f5c4ec95 100644
--- a/src/drivers/SVG/Fl_SVG_File_Surface.cxx
+++ b/src/drivers/SVG/Fl_SVG_File_Surface.cxx
@@ -212,8 +212,10 @@ void Fl_SVG_Graphics_Driver::compute_dasharray(float s, char *dashes) {
}
int dash_part = line_style_ & 0xFF;
if (dash_part == FL_SOLID) {
- if (dasharray_ && strcmp(dasharray_, "none")) free(dasharray_);
- dasharray_ = fl_strdup("none");
+ if (strcmp(dasharray_, "none")) {
+ if (dasharray_) free(dasharray_);
+ dasharray_ = fl_strdup("none");
+ }
} else {
int cap_part = (line_style_ & 0xF00);
bool is_flat = (cap_part == FL_CAP_FLAT || cap_part == 0);