Call: return NULL and 0 len when no calls are to be listed
authorPaul Kocialkowski <contact@paulk.fr>
Wed, 19 Sep 2012 17:04:07 +0000 (19:04 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Wed, 19 Sep 2012 17:04:07 +0000 (19:04 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
call.c

diff --git a/call.c b/call.c
index 8a7f8cf..7b4a96b 100644 (file)
--- a/call.c
+++ b/call.c
@@ -167,6 +167,13 @@ void ipc_call_list(struct ipc_message_info *info)
        int i;
 
        num_entries = *((unsigned char *) info->data);
+
+       if(num_entries == 0) {
+               // Don't bother with mem alloc
+
+               RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_SUCCESS, NULL, 0);
+       }
+
        entry = (struct ipc_call_list_entry *) ((char *) info->data + 1);
 
        RIL_Call **calls = (RIL_Call **) malloc(num_entries * sizeof(RIL_Call *));