ImageMagick before 7.0.8-50 has a memory leak vulnerability in the function ReadPSImage in coders/ps.c.
cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*
BF97F7CB-3E80-4DBB-8854-FF5C012BA0FA
6.9.10-50
cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*
F8AB2B06-598F-4F38-813C-B1E3E1E7EEE5
7.0.8-50
7.0.0-0
OR
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
07B237A9-69A3-4A9C-9DA0-4E06BD37AE73
OR
cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*
F7016A2A-8365-4F1A-89A2-7A19F2BCAE5B
cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*
23A7C53F-B80F-4E6A-AFA9-58EEA84BE11D
cpe:2.3:o:canonical:ubuntu_linux:19.04:*:*:*:*:*:*:*
CD783B0C-9246-47D9-A937-6144FE8BFF0F
cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*
A31C8344-3E02-4EB8-8BD8-4C84B7959624
OR
### Prerequisites

- [ Y ] I have written a descriptive issue title
- [ Y ] I have verified that I am using the latest version of ImageMagick
- [ Y ] I have searched [open](https://github.com/ImageMagick/ImageMagick/issues) and [closed](https://github.com/ImageMagick/ImageMagick/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported

### Description
<!-- A description of the bug or feature -->

There is a memory leak issue in ReadPSImage in coder/ps.c

```
      page_geometry=GetPageGeometry(option);
      flags=ParseMetaGeometry(page_geometry,&page.x,&page.y,&page.width,
        &page.height);
      if (flags == NoValue)
        {
          (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
            "InvalidGeometry","`%s'",option);
          image=DestroyImage(image);
          return((Image *) NULL);
        }
      page.width=(size_t) ceil((double) (page.width*image->resolution.x/delta.x)
        -0.5);
      page.height=(size_t) ceil((double) (page.height*image->resolution.y/
        delta.y) -0.5);
      page_geometry=DestroyString(page_geometry);
      fitPage=MagickTrue;
```
https://github.com/ImageMagick/ImageMagick/blob/master/coders/ps.c#L740

It is possible that page_geometry is not destroyed since there is a return statement before it.
It is the issue which is similar to the one fixed in https://github.com/ImageMagick/ImageMagick/commit/15be797d622655244e4c57cc5e9e4cba013011f8



Memory leak in ReadPSImage in coder/ps.c
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Memory leak in ReadPSImage in coder/ps.c
Issue date:

--- start body ---
### Prerequisites

- [ Y ] I have written a descriptive issue title
- [ Y ] I have verified that I am using the latest version of ImageMagick
- [ Y ] I have searched [open](https://github.com/ImageMagick/ImageMagick/issues) and [closed](https://github.com/ImageMagick/ImageMagick/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported

### Description
<!-- A description of the bug or feature -->

There is a memory leak issue in ReadPSImage in coder/ps.c

```
      page_geometry=GetPageGeometry(option);
      flags=ParseMetaGeometry(page_geometry,&page.x,&page.y,&page.width,
        &page.height);
      if (flags == NoValue)
        {
          (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
            "InvalidGeometry","`%s'",option);
          image=DestroyImage(image);
          return((Image *) NULL);
        }
      page.width=(size_t) ceil((double) (page.width*image->resolution.x/delta.x)
        -0.5);
      page.height=(size_t) ceil((double) (page.height*image->resolution.y/
        delta.y) -0.5);
      page_geometry=DestroyString(page_geometry);
      fitPage=MagickTrue;
```
https://github.com/ImageMagick/ImageMagick/blob/master/coders/ps.c#L740

It is possible that page_geometry is not destroyed since there is a return statement before it.
It is the issue which is similar to the one fixed in https://github.com/ImageMagick/ImageMagick/commit/15be797d622655244e4c57cc5e9e4cba013011f8



--- end body ---

comments :
--- start comments ---

--- end comments ---