gweb: Don't use debug functionality after possible free
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 7 Sep 2012 08:00:56 +0000 (11:00 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 11 Sep 2012 09:39:20 +0000 (12:39 +0300)
When the callback has been called, the whole structure might be
freed. Thus don't call the debug function tied to the structure.

gweb/gweb.c

index 27ed634..4c2f95c 100644 (file)
@@ -434,7 +434,6 @@ gboolean g_web_get_close_connection(GWeb *web)
 
 static inline void call_result_func(struct web_session *session, guint16 status)
 {
-       gboolean result;
 
        if (session->result_func == NULL)
                return;
@@ -442,10 +441,8 @@ static inline void call_result_func(struct web_session *session, guint16 status)
        if (status != 0)
                session->result.status = status;
 
-       result = session->result_func(&session->result, session->user_data);
+       session->result_func(&session->result, session->user_data);
 
-       debug(session->web, "[result function] %s",
-                                       result == TRUE ? "continue" : "stop");
 }
 
 static inline void call_route_func(struct web_session *session)