ims_usrloc_pcscf: fix value array size and compile warnings
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 23 Apr 2020 08:21:22 +0000 (10:21 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 23 Apr 2020 08:21:22 +0000 (10:21 +0200)
src/modules/ims_usrloc_pcscf/pcontact.c
src/modules/ims_usrloc_pcscf/usrloc_db.c

index 1ac5573..e597a0d 100644 (file)
@@ -123,8 +123,9 @@ void free_security(security_t* _p)
         return;
     }
 
-    if(_p->sec_header.s)
+    if(_p->sec_header.s) {
         shm_free(_p->sec_header.s);
+       }
 
     switch (_p->type)
     {
@@ -144,8 +145,9 @@ void free_security(security_t* _p)
         break;
 
         case SECURITY_TLS:
-                       if(_p->data.tls)
+                       if(_p->data.tls) {
                                shm_free(_p->data.tls);
+                       }
         break;
         
         case SECURITY_NONE:
index ba71673..ca57a2b 100644 (file)
@@ -213,7 +213,7 @@ int db_update_pcontact(pcontact_t* _c)
 int db_delete_pcontact(pcontact_t* _c)
 {
        LM_DBG("Trying to delete contact: aor[%.*s], received port %u\n", _c->aor.len, _c->aor.s, _c->received_port);
-       db_val_t values[1];
+       db_val_t values[2];
        db_key_t match_keys[2] = { &aor_col, &received_port_col };
 
        VAL_TYPE(values) = DB1_STR;