Skip to content
Snippets Groups Projects
Commit b1cbde10 authored by anonymouspage's avatar anonymouspage
Browse files

ciolib_puttext: free() is not reachable

As far as I can tell, this free() in ciolib_puttext() is not reachable
given the current logic in the function; and, the value of buf is not
modified by any called functions.

Also, this function is invoked with stack allocated buffers, so it
isn't safe to assume a free() is valid in this context. Better to let
the owner of the buffer manage the lifecycle.
parent 370669c0
No related branches found
No related tags found
No related merge requests found
Pipeline #3315 failed
......@@ -1170,13 +1170,10 @@ CIOLIBEXPORT void ciolib_normvideo(void)
*/
CIOLIBEXPORT int ciolib_puttext(int a,int b,int c,int d,void *e)
{
char *buf=e;
int ret;
CIOLIB_INIT();
ret = cio_api.puttext(a,b,c,d,(void *)buf);
if (buf != e)
free(buf);
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment