Memory leak in 0.17.1

From: Nigel Horne <njh_at_bandsman.co.uk>
Date: Mon, 27 Aug 2007 09:02:04 +0100

If realloc fails, pen_realloc returns NULL.

In this circumstance there is a memory leak at

acls[a] = pen_realloc(acls[a], nacls[a]*sizeof(acl));

Since the *old* value of acls[a] is never freed.
I suspect that this is because of the common misunderstanding that is
        foo = realloc(bar, 256)
returns NULL that bar is freed. It isn't.

Furthermore, is pen_realloc fails something is really wrong and it's quite
possible that error("Can't realloc %ld bytes", (long)n); will also fail, so
the program ought to die.

-Nigel

-- 
Nigel Horne. Adjudicator, Arranger, Band Trainer, Composer, Tutor, Typesetter.
NJH Music, Barnsley, UK.  ICQ#20252325
njh@bandsman.co.uk http://www.bandsman.co.uk

Received on Mon Aug 27 2007 - 10:04:37 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 27 2007 - 10:04:40 CEST