summaryrefslogtreecommitdiff
path: root/libgphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-01-05 20:35:33 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-01-05 20:35:33 +0000
commit33473cf6382b51008d4ae820388d071a8ce2e815 (patch)
tree2e66d3a5ae46dd9b0a73d6f242606d5a2078d698 /libgphoto2
parent1efcd217fbf2162c6157fd04a97b08452beff58f (diff)
downloadlibgphoto2-33473cf6382b51008d4ae820388d071a8ce2e815.tar.gz
free allocated memory on erropr (Coverity)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14640 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2')
-rw-r--r--libgphoto2/ahd_bayer.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/libgphoto2/ahd_bayer.c b/libgphoto2/ahd_bayer.c
index f9b69955a..e5c6b5ac3 100644
--- a/libgphoto2/ahd_bayer.c
+++ b/libgphoto2/ahd_bayer.c
@@ -428,37 +428,46 @@ int gp_ahd_interpolate (unsigned char *image, int w, int h, BayerTile tile)
window_h = calloc (w * 18, 1);
if (!window_h) {
- free (window_h);
GP_DEBUG("Out of memory\n");
return GP_ERROR_NO_MEMORY;
}
window_v = calloc(w * 18, 1);
if (!window_v) {
- free (window_v);
+ free (window_h);
GP_DEBUG("Out of memory\n");
return GP_ERROR_NO_MEMORY;
}
homo_h = calloc(w*3, 1);
if (!homo_h) {
- free (homo_h);
+ free (window_v);
+ free (window_h);
GP_DEBUG("Out of memory\n");
return GP_ERROR_NO_MEMORY;
}
homo_v = calloc(w*3, 1);
if (!homo_v) {
- free (homo_v);
+ free (window_v);
+ free (window_h);
+ free (homo_h);
GP_DEBUG("Out of memory\n");
return GP_ERROR_NO_MEMORY;
}
homo_ch = calloc (w, 1);
if (!homo_ch) {
- free (homo_ch);
+ free (window_v);
+ free (window_h);
+ free (homo_h);
+ free (homo_v);
GP_DEBUG("Out of memory\n");
return GP_ERROR_NO_MEMORY;
}
homo_cv = calloc (w, 1);
if (!homo_cv) {
+ free (window_v);
+ free (window_h);
free (homo_ch);
+ free (homo_v);
+ free (homo_h);
GP_DEBUG("Out of memory\n");
return GP_ERROR_NO_MEMORY;
}