In ImageMagick before 7.0.8-25, some memory leaks exist in DecodeImage in coders/pcd.c.
### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have verified that I am using the latest version of ImageMagick
- [x] 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 -->
memory leak in DecodeImage in coders/pcd.c, which is different from #1193 and #811 

### Steps to Reproduce
<!-- List of steps, sample code, failing test or link to a project that reproduces the behavior.
     Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues -->
The critical code snippet is:
https://github.com/ImageMagick/ImageMagick/blob/master/coders/pcd.c#L198
```c
for (i=0; i < (image->columns > 1536 ? 3 : 1); i++)
  {
    PCDGetBits(8);
    length=(sum & 0xff)+1;
    pcd_table[i]=(PCDTable *) AcquireQuantumMemory(length,  //line 202
      sizeof(*pcd_table[i]));
    if (pcd_table[i] == (PCDTable *) NULL)              //line 204
      {
        buffer=(unsigned char *) RelinquishMagickMemory(buffer); 
        ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",  //line 207
          image->filename);
      }
    r=pcd_table[i];
    for (j=0; j < (ssize_t) length; j++)
    {
      PCDGetBits(8);
      r->length=(unsigned int) (sum & 0xff)+1;
      if (r->length > 16)                                       //line 215
        {
          buffer=(unsigned char *) RelinquishMagickMemory(buffer);
          return(MagickFalse);                            //line 218
        }
      PCDGetBits(16);
      r->sequence=(unsigned int) (sum & 0xffff) << 16;
      PCDGetBits(8);
      r->key=(unsigned char) (sum & 0xff);
      r->mask=(~((1U << (32-r->length))-1));
      r++;
    }
    pcd_length[i]=(size_t) length;
  }
```
**pcd_table[i]** is allocated at *line 202*, however, **pcd_table[0~i]** are forgot to be freed when exception happens at line *204* or function returns at *line 215*. **pcd_table** is a local array variable and it isn't passed to the caller function when DecodeImage returns with MagickFalse at *line 207 and 218*. As a result, the allocated memory pcd_table[0~(i-1)] (or pcd_table[0~i] when returned at line 218) will not be freed and memory leak happens.

The max size of leaked memory is 3*(0xff+1)*sizeof(*pcd_table[0])

The patch suggestion:
```c
if (pcd_table[i] == (PCDTable *) NULL)    //line 204
      {
        buffer=(unsigned char *) RelinquishMagickMemory(buffer);
        for (k=0; k < i; k++)
          pcd_table[k] = (PCDTable *)RelinquishMagickMemory(pcd_table[k]);
        ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
          image->filename);
      }

if (r->length > 16)
        {
          buffer=(unsigned char *) RelinquishMagickMemory(buffer);
          for (k=0; k <= i; k++)
            pcd_table[k] = (PCDTable *)RelinquishMagickMemory(pcd_table[k]);
          return(MagickFalse);
        }
```
### System Configuration
<!-- Tell us about the environment where you are experiencing the bug -->

- ImageMagick version: ImageMagick-4f0ea40e2a090e245f31d1f05247520d6e7eb4ca
- Environment (Operating system, version and so on): Ubuntu 16.04
- Additional information:  

<!-- Thanks for reporting the issue to ImageMagick! -->
Credit to Bingchang Liu at VARAS of IIE
memory leak in DecodeImage in coders/pcd.c different from #1193 and #811
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : memory leak in DecodeImage in coders/pcd.c different from #1193 and #811
Issue date:

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

- [x] I have written a descriptive issue title
- [x] I have verified that I am using the latest version of ImageMagick
- [x] 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 -->
memory leak in DecodeImage in coders/pcd.c, which is different from #1193 and #811 

### Steps to Reproduce
<!-- List of steps, sample code, failing test or link to a project that reproduces the behavior.
     Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues -->
The critical code snippet is:
https://github.com/ImageMagick/ImageMagick/blob/master/coders/pcd.c#L198
```c
for (i=0; i < (image->columns > 1536 ? 3 : 1); i++)
  {
    PCDGetBits(8);
    length=(sum & 0xff)+1;
    pcd_table[i]=(PCDTable *) AcquireQuantumMemory(length,  //line 202
      sizeof(*pcd_table[i]));
    if (pcd_table[i] == (PCDTable *) NULL)              //line 204
      {
        buffer=(unsigned char *) RelinquishMagickMemory(buffer); 
        ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",  //line 207
          image->filename);
      }
    r=pcd_table[i];
    for (j=0; j < (ssize_t) length; j++)
    {
      PCDGetBits(8);
      r->length=(unsigned int) (sum & 0xff)+1;
      if (r->length > 16)                                       //line 215
        {
          buffer=(unsigned char *) RelinquishMagickMemory(buffer);
          return(MagickFalse);                            //line 218
        }
      PCDGetBits(16);
      r->sequence=(unsigned int) (sum & 0xffff) << 16;
      PCDGetBits(8);
      r->key=(unsigned char) (sum & 0xff);
      r->mask=(~((1U << (32-r->length))-1));
      r++;
    }
    pcd_length[i]=(size_t) length;
  }
```
**pcd_table[i]** is allocated at *line 202*, however, **pcd_table[0~i]** are forgot to be freed when exception happens at line *204* or function returns at *line 215*. **pcd_table** is a local array variable and it isn't passed to the caller function when DecodeImage returns with MagickFalse at *line 207 and 218*. As a result, the allocated memory pcd_table[0~(i-1)] (or pcd_table[0~i] when returned at line 218) will not be freed and memory leak happens.

The max size of leaked memory is 3*(0xff+1)*sizeof(*pcd_table[0])

The patch suggestion:
```c
if (pcd_table[i] == (PCDTable *) NULL)    //line 204
      {
        buffer=(unsigned char *) RelinquishMagickMemory(buffer);
        for (k=0; k < i; k++)
          pcd_table[k] = (PCDTable *)RelinquishMagickMemory(pcd_table[k]);
        ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
          image->filename);
      }

if (r->length > 16)
        {
          buffer=(unsigned char *) RelinquishMagickMemory(buffer);
          for (k=0; k <= i; k++)
            pcd_table[k] = (PCDTable *)RelinquishMagickMemory(pcd_table[k]);
          return(MagickFalse);
        }
```
### System Configuration
<!-- Tell us about the environment where you are experiencing the bug -->

- ImageMagick version: ImageMagick-4f0ea40e2a090e245f31d1f05247520d6e7eb4ca
- Environment (Operating system, version and so on): Ubuntu 16.04
- Additional information:  

<!-- Thanks for reporting the issue to ImageMagick! -->
Credit to Bingchang Liu at VARAS of IIE
--- end body ---
