Browse Source

mi_rpc: don't access fields in structure after free in mi_rpc_async_close()

Daniel-Constantin Mierla 11 năm trước cách đây
mục cha
commit
f619a813ef
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      modules/mi_rpc/mi_rpc_mod.c

+ 1 - 1
modules/mi_rpc/mi_rpc_mod.c

@@ -323,8 +323,8 @@ static void mi_rpc_async_close(struct mi_root* mi_rpl,
 		if (dctx==0){
 			BUG("null dctx\n");
 			shm_free(mi_h->param);
-			shm_free(mi_h);
 			mi_h->param=0;
+			shm_free(mi_h);
 			goto error;
 		}
 		mode=((struct mi_rpc_handler_param*)mi_h->param)->mode;