int main()
{
    gdImagePtr im1, im2;
    FILE *fp;
    int size;

    fp = gdTestFileOpen2("webp", "bug_double_free.jpg");
    gdTestAssert(fp != NULL);
    im1 = gdImageCreateFromJpeg(fp);
    gdTestAssert(im1 != NULL);
    fclose(fp);

    im2 = gdImageWebpPtr(im1, &size);
    gdTestAssert(im2 == NULL);

    gdImageDestroy(im1);

    return gdNumFailures();
}
The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.