]> diplodocus.org Git - nmh/commit
readline(3) wrapper: Move free(3) of line to where it's reachable.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 14:03:09 +0000 (15:03 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 14:03:09 +0000 (15:03 +0100)
commit544d453bef5ccf734140f36efb1efd08ab8d71cb
tree2e038b682a9c5f4bdd29dacf8a087920a207addc
parentedcbc70e11973f191f960a4102708b195dc378bf
readline(3) wrapper: Move free(3) of line to where it's reachable.

Every line returned by readline() has to be freed.  The call to free()
was unreachable because all paths heading towards it veered off,
resulting in a memory leak.  Move the free() to just after where the
line has been used for the last time.  Fixes 3a85e0bc9.
sbr/read_switch_multiword_via_readline.c