mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 06:45:17 +00:00
timeval: Fix seq memory leak
'timewarp_seq' should be initialized only once, while init_clock() is called multiple times (once for each clock instance). Found by valgrind Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
committed by
Jarno Rajahalme
parent
88ace79b3e
commit
33c24cf9f4
@@ -114,7 +114,6 @@ init_clock(struct clock *c, clockid_t id)
|
|||||||
ovs_mutex_init(&c->mutex);
|
ovs_mutex_init(&c->mutex);
|
||||||
atomic_init(&c->slow_path, false);
|
atomic_init(&c->slow_path, false);
|
||||||
xclock_gettime(c->id, &c->cache);
|
xclock_gettime(c->id, &c->cache);
|
||||||
timewarp_seq = seq_create();
|
|
||||||
memset(&c->large_warp, 0, sizeof(c->large_warp));
|
memset(&c->large_warp, 0, sizeof(c->large_warp));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +124,7 @@ do_init_time(void)
|
|||||||
|
|
||||||
coverage_init();
|
coverage_init();
|
||||||
|
|
||||||
|
timewarp_seq = seq_create();
|
||||||
init_clock(&monotonic_clock, (!clock_gettime(CLOCK_MONOTONIC, &ts)
|
init_clock(&monotonic_clock, (!clock_gettime(CLOCK_MONOTONIC, &ts)
|
||||||
? CLOCK_MONOTONIC
|
? CLOCK_MONOTONIC
|
||||||
: CLOCK_REALTIME));
|
: CLOCK_REALTIME));
|
||||||
|
Reference in New Issue
Block a user