]> git.tuebingen.mpg.de Git - paraslash.git/commit
Fix an invalid free() in command handlers.
authorAndre Noll <maan@systemlinux.org>
Sun, 26 Apr 2009 16:08:13 +0000 (18:08 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 26 Apr 2009 16:08:13 +0000 (18:08 +0200)
commitad81d625737e1c096c154aedd8a1d161d3ee592e
treec8c585cc3a0e3185107fcf00c3a68f0ca8d6b399
parent1c4fca3000b98973a433bfd80290d159fd6696a7
Fix an invalid free() in command handlers.

The chunk table and the info_string are pointers located in the mmd
struct that point to dynamically allocated memory that must be freed
by the parent and the child. However, as the mmd struct is in a shared
memory area, there's no guarantee that after the fork these pointers
are still valid in child context. As these two pointers are not used
in the child anyway, we save them to local variables and free the
memory via that copy in the child.

This gets rid of

*** glibc detected *** para_server (serving 127.0.0.1#53650): double free or corruption (!prev): 0x08086fe0 ***
command.c
server.c