--- imageinfo.c 2007-08-30 08:37:27.000000000 +0800 +++ ../imageinfo.c 2023-08-03 14:04:19.771321619 +0800 @@ -133,13 +133,14 @@ poptFreeContext(poptctxt); exit(2); } - poptFreeContext(poptctxt); if (!filename) { fprintf(stderr, "imageinfo: must specify a filename\n"); + poptFreeContext(poptctxt); exit(3); } if (optorder[0] == 0) { fprintf(stderr, "imageinfo: must specify at least one output flag\n"); + poptFreeContext(poptctxt); exit(4); } @@ -161,6 +162,8 @@ GetExceptionInfo(&exception); image_info=CloneImageInfo((ImageInfo *) NULL); strcpy(image_info->filename, filename); + poptFreeContext(poptctxt); + if (readimage) image = ReadImage(image_info, &exception); else