diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-11-06 09:59:04 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-11-06 09:59:04 +0000 |
| commit | 9e9eda4a34ce2afee9a78737c2d5d94373d625a7 (patch) | |
| tree | 6f7abde130b1d9c1664e9635ab000a5bafb2a622 /src/ui/clipboard.cpp | |
| parent | fix poppler 0.71.0 build. (diff) | |
| download | inkscape-9e9eda4a34ce2afee9a78737c2d5d94373d625a7.tar.gz inkscape-9e9eda4a34ce2afee9a78737c2d5d94373d625a7.zip | |
fix memory leak in ClipboardManagerImpl
Diffstat (limited to 'src/ui/clipboard.cpp')
| -rw-r--r-- | src/ui/clipboard.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index b2d8fe58b..a18df5675 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -1245,7 +1245,8 @@ void ClipboardManagerImpl::_onGet(Gtk::SelectionData &sel, guint /*info*/) // FIXME: Temporary hack until we add support for memory output. // Save to a temporary file, read it back and then set the clipboard contents gchar *filename = g_build_filename( g_get_user_cache_dir(), "inkscape-clipboard-export", NULL ); - gsize len; gchar *data; + gchar *data = nullptr; + gsize len; try { if (out == outlist.end() && target == "image/png") @@ -1288,6 +1289,7 @@ void ClipboardManagerImpl::_onGet(Gtk::SelectionData &sel, guint /*info*/) g_unlink(filename); // delete the temporary file g_free(filename); + g_free(data); } |
