osip-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[osip-dev] inconsistencies in eXosip_insubscription_send_answer


From: FEICHTER Christoph
Subject: [osip-dev] inconsistencies in eXosip_insubscription_send_answer
Date: Thu, 20 Oct 2016 10:57:40 +0000

hi,

 

… and some inconsistencies in eXosip_insubscription_send_answer.

the function should cleanup osip_message_t * answer in all failure cases the same way:

 

int

eXosip_insubscription_send_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t * answer)

{

  int i = -1;

  eXosip_dialog_t *jd = NULL;

  eXosip_notify_t *jn = NULL;

  osip_transaction_t *tr = NULL;

  osip_event_t *evt_answer;

 

  if (tid <= 0) {

    osip_message_free (answer);

    return OSIP_BADPARAMETER;

  }

 

  if (tid > 0) {

    _eXosip_insubscription_transaction_find (excontext, tid, &jn, &jd, &tr);

  }

  if (jd == NULL || tr == NULL || tr->orig_request == NULL || tr->orig_request->sip_method == NULL) {

    OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_ERROR, NULL, "eXosip: No incoming subscription here?\n"));

    osip_message_free (answer);

    return OSIP_NOTFOUND;

  }

 

  if (answer == NULL) {

    if (0 == osip_strcasecmp (tr->orig_request->sip_method, "SUBSCRIBE") || 0 == osip_strcasecmp (tr->orig_request->sip_method, "REFER")) {

      if (status >= 200 && status <= 299) {

        OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_ERROR, NULL, "eXosip: provide a prepared answer\n"));

        return OSIP_BADPARAMETER;

      }

    }

  }

 

 

further down in this function answer is freed,

using the same return value OSIP_BADPARAMETER.

 

br,

christoph

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]