Re: [PATCH] voicecall: Handle voicecall_dbus_register() return value

2018-06-25 Thread Denis Kenzior

Hi Slava,

On 06/23/2018 11:08 AM, Slava Monich wrote:

FALSE means that struct voicecall passed in as a parameter
has been deallocated.
---
  src/voicecall.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)



Is there an actual issue you're fixing?  Or is this just a be paranoid 
patch?



diff --git a/src/voicecall.c b/src/voicecall.c
index e4f6a4c..194b75f 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1391,7 +1391,9 @@ static struct voicecall *synthesize_outgoing_call(struct 
ofono_voicecall *vc,
v->detect_time = time(NULL);
  
  	DBG("Registering new call: %d", call->id);

-   voicecall_dbus_register(v);
+
+   if (!voicecall_dbus_register(v))
+   return NULL;


Okay, but you probably also want to release the callid which is being 
held above.


  
  	vc->call_list = g_slist_insert_sorted(vc->call_list, v, call_compare);
  



Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


[PATCH] voicecall: Handle voicecall_dbus_register() return value

2018-06-23 Thread Slava Monich
FALSE means that struct voicecall passed in as a parameter
has been deallocated.
---
 src/voicecall.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index e4f6a4c..194b75f 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1391,7 +1391,9 @@ static struct voicecall *synthesize_outgoing_call(struct 
ofono_voicecall *vc,
v->detect_time = time(NULL);
 
DBG("Registering new call: %d", call->id);
-   voicecall_dbus_register(v);
+
+   if (!voicecall_dbus_register(v))
+   return NULL;
 
vc->call_list = g_slist_insert_sorted(vc->call_list, v, call_compare);
 
-- 
1.9.1

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono