diff options
author | Denis Kenzior <denis.kenzior@intel.com> | 2009-12-01 12:18:06 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-12-01 12:45:40 -0600 |
commit | d2bcc0921d132ab155534f388501dbfa25e76435 (patch) | |
tree | caa37f647d0e7f58e578b6a5879cf120b4044824 /src | |
parent | d1e62194effdc8e137e67f4ba03a356f3945547f (diff) | |
download | ofono-d2bcc0921d132ab155534f388501dbfa25e76435.tar.bz2 |
Fix: Simplify logic to use g_memdup
Diffstat (limited to 'src')
-rw-r--r-- | src/voicecall.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/voicecall.c b/src/voicecall.c index f0cebe6f..c89b2beb 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -1531,7 +1531,7 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc, struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); GSList *l; struct voicecall *v = NULL; - struct ofono_call *newcall = NULL; + struct ofono_call *newcall; ofono_debug("Got a voicecall event, status: %d, id: %u, number: %s", call->status, call->id, call->phone_number.number); @@ -1550,15 +1550,13 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc, ofono_debug("Did not find a call with id: %d\n", call->id); - newcall = g_try_new0(struct ofono_call, 1); + newcall = g_memdup(call, sizeof(struct ofono_call)); - if (!call) { + if (!newcall) { ofono_error("Unable to allocate call"); goto err; } - memcpy(newcall, call, sizeof(struct ofono_call)); - if (__ofono_modem_alloc_callid(modem) != call->id) { ofono_error("Warning: Call id and internally tracked id" " do not correspond"); |