void * gdImageGifPtr (gdImagePtr im, int *size)
{
  void *rv;
  gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
	if (!_gdImageGifCtx(im, out)) {
		rv = gdDPExtractData(out, size);
	} else {
		rv = NULL;
	}
  out->gd_free (out);
  return rv;
}
The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.