Drop the reference count on the correct object.
[asterisk/asterisk.git] / channels / chan_gulp.c
index e3d3ed0..dbc6d4f 100644 (file)
@@ -1510,7 +1510,7 @@ static int hangup(void *data)
        }
 
        clear_session_and_channel(session, ast, pvt);
-       ao2_cleanup(pvt);
+       ao2_cleanup(channel);
        ao2_cleanup(h_data);
 
        return 0;
@@ -1540,7 +1540,7 @@ failure:
         * to be able to send our SIP request/response
         */
        clear_session_and_channel(channel->session, ast, pvt);
-       ao2_cleanup(pvt);
+       ao2_cleanup(channel);
        ao2_cleanup(h_data);
 
        return -1;