Skip to content
Snippets Groups Projects
Commit 740cae09 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla
Browse files

fastrpc: apps_user: check args before freeing.


args pointer can be uninitalized before calling free.
Code path for this is via VERIFYC macro jumping to bail label
which is not very explicit from the code.

Fixes: 7797ba9c (apps_user: fix memory leak)
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
parent 7adc8f56
No related branches found
No related tags found
No related merge requests found
......@@ -748,7 +748,7 @@ static int fdlist_fd_to_buf(void *buf)
int remote_handle_invoke_domain(int domain, remote_handle handle, uint32_t sc, remote_arg* pra) {
struct fastrpc_invoke invoke;
struct fastrpc_invoke_args *args;
struct fastrpc_invoke_args *args = NULL;
int bufs, i, req, nErr = 0;
int dev;
VERIFY(dev != -1);
......@@ -795,7 +795,9 @@ int remote_handle_invoke_domain(int domain, remote_handle handle, uint32_t sc, r
FARF(HIGH,"debug:sc:%x,handle:%x\n",sc,handle);
nErr = ioctl(dev, req, (unsigned long)&invoke);
bail:
free(args);
if (args)
free(args);
return nErr;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment