thread storage: fix memset 0 after realloc

Thread storage expansion would not properly memset 0 the new part
of the memory.
pull/2081/head
Victor Julien 10 years ago
parent 667e4e68bf
commit 90414472ed

@ -2283,7 +2283,7 @@ int TmThreadsRegisterThread(ThreadVars *tv, const int type)
void *newmem = SCRealloc(thread_store.threads, ((thread_store.threads_size + STEP) * sizeof(Thread)));
BUG_ON(newmem == NULL);
thread_store.threads = newmem;
memset((uint8_t *)thread_store.threads + (thread_store.threads_size * sizeof(Thread)), 0x00, STEP);
memset((uint8_t *)thread_store.threads + (thread_store.threads_size * sizeof(Thread)), 0x00, STEP * sizeof(Thread));
Thread *t = &thread_store.threads[thread_store.threads_size];
t->name = tv->name;

Loading…
Cancel
Save