瀏覽代碼

cdp: fix compiler warnings

> acctstatemachine.c: In function 'update_gsu_response_timers':
> acctstatemachine.c:80:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
>   if (mscc_avp_list.head);
>   ^~
> acctstatemachine.c:81:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
>    AAAFreeAVPList(&mscc_avp_list);
>    ^~~~~~~~~~~~~~

> authstatemachine.c: In function 'add_auth_session_timers':
> authstatemachine.c:234:32: warning: 'lifetime' may be used uninitialized in this function [-Wmaybe-uninitialized]
>       x->last_requested_timeout = lifetime;
>       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Victor Seva 8 年之前
父節點
當前提交
03e6757d78
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      src/modules/cdp/acctstatemachine.c
  2. 2 1
      src/modules/cdp/authstatemachine.c

+ 1 - 1
src/modules/cdp/acctstatemachine.c

@@ -77,7 +77,7 @@ void update_gsu_response_timers(cdp_cc_acc_session_t* session, AAAMessage* msg)
 		mscc_avp = mscc_avp->next;
 	}
 
-	if (mscc_avp_list.head);
+	if (mscc_avp_list.head)
 		AAAFreeAVPList(&mscc_avp_list);
 	
 	if (y.head)

+ 2 - 1
src/modules/cdp/authstatemachine.c

@@ -157,7 +157,8 @@ void add_auth_session_timers(cdp_auth_session_t *x, AAAMessage *msg) {
 	AAA_AVP *avp;
 	char data[4];
 	uint32_t v;
-	uint32_t lifetime, timeout, grace;
+	uint32_t lifetime = 0;
+	uint32_t timeout, grace;
 
 	avp = AAAFindMatchingAVP(msg, 0, AVP_Authorization_Lifetime, 0, 0);
 	if (!avp) {