diff options
author | Even Rouault <even.rouault@spatialys.com> | 2022-11-23 11:03:03 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2022-11-23 11:03:03 +0000 |
commit | 8e264807f103fee9361d8fbd32fbbca34619080e (patch) | |
tree | f4f3fdd8ebd766df517594392a39b313e59baae1 | |
parent | e920f4fee37f556b4844a67712ad6a3d050ff654 (diff) | |
parent | b6480e872abc920f0157f8fed354a966df581c2f (diff) | |
download | libtiff-git-8e264807f103fee9361d8fbd32fbbca34619080e.tar.gz |
Merge branch 'tiffcp_TIFFOpenOptionsFree_memleak_fix' into 'master'
tiffcp: fix leak of TIFFOpenOptionsAlloc() introduced in latest commit (master only)
See merge request libtiff/libtiff!420
-rw-r--r-- | tools/tiffcp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/tiffcp.c b/tools/tiffcp.c index 4b9f1e77..ca20119d 100644 --- a/tools/tiffcp.c +++ b/tools/tiffcp.c @@ -168,7 +168,11 @@ static TIFF* openSrcImage (char **imageSpec) **imageSpec = '\0'; tif = TIFFOpenExt (fn, mode, opts); /* but, ignore any single trailing comma */ - if (!(*imageSpec)[1]) {*imageSpec = NULL; return tif;} + if (!(*imageSpec)[1]) { + *imageSpec = NULL; + TIFFOpenOptionsFree(opts); + return tif; + } if (tif) { **imageSpec = comma; /* replace the comma */ if (!nextSrcImage(tif, imageSpec)) { |