diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2013-05-01 12:13:28 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2013-05-01 12:13:28 +0000 |
commit | e0bb1b7e7fbe4f89b8a994b6883bbeb1a2ee3dc0 (patch) | |
tree | 53034620620663ebc351d1f4b2ebce0c8bf2102b | |
parent | 56dd50b9a2e357dc8a30f06a436f581765337782 (diff) | |
download | libgphoto2-e0bb1b7e7fbe4f89b8a994b6883bbeb1a2ee3dc0.tar.gz |
free buf in error path
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14377 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/hp215/hp215.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/camlibs/hp215/hp215.c b/camlibs/hp215/hp215.c index 8f4afda4f..b14d6853f 100644 --- a/camlibs/hp215/hp215.c +++ b/camlibs/hp215/hp215.c @@ -182,6 +182,8 @@ hp_gen_cmd_blob (enum hp215_cmd cmd, int bytes, unsigned char *argdata, unsigned (*buf)[1] = cmd; if (bytes >= 0x7d) { gp_log (GP_LOG_ERROR, "hp215", "Using too large argument buffer %d bytes", bytes); + free (*buf); + *buf = NULL; return GP_ERROR_BAD_PARAMETERS; } /* store arglen */ @@ -395,6 +397,7 @@ hp_get_timeDate_cam (Camera *cam, char *txtbuffer, size_t txtbuffersize) return ret; xmsg = msg; if (msglen < 0x59) { + free (msg); gp_log (GP_LOG_ERROR, "hp215", "too short reply block, %d bytes", msglen); return GP_ERROR_IO; } |