diff options
author | Albert Astals Cid <aacid@kde.org> | 2020-12-26 12:21:22 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2020-12-26 12:21:22 +0100 |
commit | 6928e8933e8b6c98c0590985866cc12e7321f491 (patch) | |
tree | f13bb76812c2347ac098175e103c78871dadf7b5 | |
parent | 155777e316aa1bbc0f3be9ed7a6e7a9b76b58968 (diff) |
Free the previous user_image in case spectre_presize is called multiple times
-rw-r--r-- | libspectre/spectre-device.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libspectre/spectre-device.c b/libspectre/spectre-device.c index 4a09518..708fcb0 100644 --- a/libspectre/spectre-device.c +++ b/libspectre/spectre-device.c @@ -72,6 +72,7 @@ spectre_presize (void *handle, void *device, int width, int height, sd->height = height; sd->row_length = raster; sd->gs_image = NULL; + free(sd->user_image); sd->user_image = malloc (sd->row_length * sd->height); return 0; |