diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-07-15 11:40:46 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-07-15 11:41:58 +0200 |
commit | e1c0ba33dff4f937b9c0f8f5bae42f2787691654 (patch) | |
tree | 2cae894649fa0a86d5bd43a1ab2ba5a7d8dfec70 | |
parent | 248b8f71e75a34c5ee35aad22ecf9953653eda95 (diff) |
vdagent: Fix double free on re-exec
This is caused by me fixing a memleak in the non re-exec reconnect patch
of Marc-André's original patch before merging it.
-rw-r--r-- | src/vdagent.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/vdagent.c b/src/vdagent.c index 5bf0452..5371ca2 100644 --- a/src/vdagent.c +++ b/src/vdagent.c @@ -150,15 +150,6 @@ static int file_test(const char *path) return stat(path, &buffer); } -static void cleanup(void) -{ - vdagent_x11_destroy(x11); - udscs_destroy_connection(&client); - - if (logfile != stderr) - fclose(logfile); -} - int main(int argc, char *argv[]) { fd_set readfds, writefds; @@ -228,7 +219,8 @@ int main(int argc, char *argv[]) reconnect: if (version_mismatch) { fprintf(logfile, "Version mismatch, restarting\n"); - cleanup(); + if (logfile != stderr) + fclose(logfile); sleep(1); execvp(argv[0], argv); } |