diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2013-03-23 20:50:18 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2013-03-23 20:50:18 +0100 |
commit | 454fb0bb71710cdcdd9917738aa785465da5cb31 (patch) | |
tree | b134f066abfc96901451784baf04c9451b79a4a5 /ipc.c | |
parent | 891d601b95f2f22f296af669aac5372778753733 (diff) | |
download | hardware_ril_samsung-ril-454fb0bb71710cdcdd9917738aa785465da5cb31.zip hardware_ril_samsung-ril-454fb0bb71710cdcdd9917738aa785465da5cb31.tar.gz hardware_ril_samsung-ril-454fb0bb71710cdcdd9917738aa785465da5cb31.tar.bz2 |
ipc: Set ipc message structure to 0 and double check before freeing
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'ipc.c')
-rw-r--r-- | ipc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -83,6 +83,8 @@ int ipc_fmt_read_loop(struct ril_client *client) FD_SET(ipc_client_fd, &fds); while (1) { + memset(&info, 0, sizeof(info)); + if (ipc_client_fd < 0) { LOGE("IPC FMT client fd is negative, aborting!"); return -1; @@ -101,7 +103,7 @@ int ipc_fmt_read_loop(struct ril_client *client) ipc_fmt_dispatch(&info); - if (info.data != NULL) + if (info.data != NULL && info.length > 0) free(info.data); } } |