diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2013-05-01 12:01:59 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2013-05-01 12:01:59 +0000 |
commit | e89764b17a38b46df13d0f0acb50c1c836da0e81 (patch) | |
tree | cd22b1a9fcdbe00d4f2cfd461fe86078e076f646 /camlibs/barbie/barbie.c | |
parent | 11d2a787dbc33cfe4ae571300eb4f874545328cf (diff) | |
download | libgphoto2-e89764b17a38b46df13d0f0acb50c1c836da0e81.tar.gz |
avoid leaking s or t
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14373 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/barbie/barbie.c')
-rw-r--r-- | camlibs/barbie/barbie.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/camlibs/barbie/barbie.c b/camlibs/barbie/barbie.c index abdd5428f..0d737801b 100644 --- a/camlibs/barbie/barbie.c +++ b/camlibs/barbie/barbie.c @@ -217,6 +217,7 @@ barbie_read_picture(GPPort *port, int picture_number, int get_thumbnail, CameraF free(us); free(rg); free(s); + free(t); return GP_ERROR_IO_READ; } /* Unshuffle the data */ @@ -237,13 +238,12 @@ barbie_read_picture(GPPort *port, int picture_number, int get_thumbnail, CameraF for (x=0; x<visrows; x++) memcpy (t+x*(cols-4)*3,s+cols*(x+blackrows)*3,(cols-4)*3); gp_file_append (file, (char*)t, visrows*(cols-4)*3); + free (s); free (t); /* read the footer */ - if (gp_port_read(port, &c, 1) < 0) { - free(s); + if (gp_port_read(port, &c, 1) < 0) return GP_ERROR_IO_READ; - } return GP_OK; } |