]> source.dussan.org Git - rspamd.git/commit
Update acism_create.c 794/head
authorBryon Gloden, CISSPĀ® <cissp@bryongloden.com>
Tue, 2 Aug 2016 21:19:19 +0000 (17:19 -0400)
committerGitHub <noreply@github.com>
Tue, 2 Aug 2016 21:19:19 +0000 (17:19 -0400)
commita7abc8348801f8bc2f802447c109083b9e199806
tree87a6d2d19e8c7080144950629d60d64e9fb5f085
parent0ef106e8a3a39c3dbd8e2cc5f24fff7e0e23ac40
Update acism_create.c

Passing one pointer into realloc() and assigning the result directly into that same pointer variable can cause a memory leak if the reallocation fails, because the original allocation will still exist. The correct way to do this is to use a temporary pointer variable.

Credit: http://stackoverflow.com/a/11548901

Found by https://github.com/bryongloden/cppcheck
contrib/aho-corasick/acism_create.c