Free memory allocated by the library.
void pdfFreeMemory(void *ptr)
This function frees memory blocks allocated by the library and returned by various other functions.

It should only be used where the documentation for the function specifically states that it is required.

char *text; text = pdfExtractTextFromPage(viewer, page, x0, y0, x1, y1, &length); .... pdfFreeMemory(text);