Explorar o código

drouting: reset the content of routing tree if root pointer is not freed

- reported by Yufei Tao
Daniel-Constantin Mierla %!s(int64=13) %!d(string=hai) anos
pai
achega
c737ff95bb
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      modules_k/drouting/routing.c

+ 2 - 1
modules_k/drouting/routing.c

@@ -460,7 +460,8 @@ free_rt_data(
 			shm_free(rt_data->noprefix.rg);
 			rt_data->noprefix.rg = 0;
 		}
-		/* del top level */
+		/* del top level or reset to 0 it's content */
 		if (all) shm_free(rt_data);
+		else memset(rt_data, 0, sizeof(rt_data_t));
 	}
 }