DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.76k stars 389 forks source link

missing free #553

Closed maddin200 closed 3 years ago

maddin200 commented 3 years ago

/src/graphics.c line 2583:

pixGetDimensions(pixs, &w, &h, NULL); xstart = (l_int32 )LEPT_CALLOC(L_MAX(1, w / 2), sizeof(l_int32)); xend = (l_int32 )LEPT_CALLOC(L_MAX(1, w / 2), sizeof(l_int32)); if (!xstart) // <-- missing LEPT_FREE(xend); return (PIX *)ERROR_PTR("xstart and xend not made", procName, NULL);

DanBloomberg commented 3 years ago

Thanks. Was assuming if one failed they'd both fail, but better not to make any assumptions.

Dan