]> granicus.if.org Git - sysstat/commitdiff
Fix CID 144609: Ressource leak
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 14 May 2017 16:52:06 +0000 (18:52 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 14 May 2017 16:52:06 +0000 (18:52 +0200)
In SREALLOC() macro: Old pointer was not freed when a realloc() had
happened.
Bug introduced by commit 569378e.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
common.h

index aeacc9cbad7624ebdc343f366cc7d3105c2634ec..fb090ed8fa3d714304e7c2332c8eb183bca6d87d 100644 (file)
--- a/common.h
+++ b/common.h
                                                }                                                \
                                                else {                                           \
                                                        memcpy(S, _p_, (SIZE));                  \
+                                                       free(_p_);                               \
                                                }                                                \
                                        }                                                        \
                                        if (!S) {                                                \