소스 검색

nats: declare variable at beginning of function

Daniel-Constantin Mierla 2 년 전
부모
커밋
d315eb26c1
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/modules/nats/nats_mod.c

+ 2 - 1
src/modules/nats/nats_mod.c

@@ -530,6 +530,7 @@ int nats_cleanup_init_servers()
 
 int nats_cleanup_connection(nats_connection_ptr c)
 {
+	int s;
 	if(c->conn != NULL) {
 		natsConnection_Close(c->conn);
 		natsConnection_Destroy(c->conn);
@@ -537,7 +538,7 @@ int nats_cleanup_connection(nats_connection_ptr c)
 	if(c->opts != NULL) {
 		natsOptions_Destroy(c->opts);
 	}
-	for(int s = 0; s < NATS_MAX_SERVERS; s++) {
+	for(s = 0; s < NATS_MAX_SERVERS; s++) {
 		if(c->servers[s]) {
 			shm_free(c->servers[s]);
 		}