summaryrefslogtreecommitdiff
path: root/libspectre
diff options
context:
space:
mode:
authorRandy <randy408@protonmail.com>2019-12-08 20:04:20 +0100
committerRandy <randy408@protonmail.com>2019-12-08 20:04:20 +0100
commit1a367871cbe7dab1a70be0779ba1b0306e41e760 (patch)
tree29e234561532ac4a5b7d06182f19b682819345d9 /libspectre
parentceeeec8ee480c9cce066c0921665ef647bd5c135 (diff)
fix leak in spectre_device_render()
Diffstat (limited to 'libspectre')
-rw-r--r--libspectre/spectre-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libspectre/spectre-device.c b/libspectre/spectre-device.c
index 691b99a..4a09518 100644
--- a/libspectre/spectre-device.c
+++ b/libspectre/spectre-device.c
@@ -371,6 +371,7 @@ spectre_device_render (SpectreDevice *device,
free (dsp_handle);
free (args);
if (!success) {
+ free (device->user_image);
spectre_gs_free (gs);
return SPECTRE_STATUS_RENDER_ERROR;
}
@@ -379,12 +380,14 @@ spectre_device_render (SpectreDevice *device,
SPECTRE_ORIENTATION_PORTRAIT);
if (!spectre_gs_send_string (gs, set)) {
free (set);
+ free (device->user_image);
spectre_gs_free (gs);
return SPECTRE_STATUS_RENDER_ERROR;
}
free (set);
if (!spectre_gs_send_page (gs, device->doc, page, x, y)) {
+ free (device->user_image);
spectre_gs_free (gs);
return SPECTRE_STATUS_RENDER_ERROR;
}