Fix dereference of previously freed data.
authorJustin Pettit <jpettit@nicira.com>
Tue, 14 Oct 2008 06:37:46 +0000 (23:37 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 14 Oct 2008 06:37:46 +0000 (23:37 -0700)
Thanks to Masa et al. for catching this.

lib/vlog-socket.c

index 2428bfa6dfb132962108f57aad24aa60b7c46245..ec0b6d4c0e760643d890b8736a0a5c8b60a8ad7a 100644 (file)
@@ -92,10 +92,10 @@ vlog_server_listen(const char *path, struct vlog_server **serverp)
     server->fd = make_unix_socket(SOCK_DGRAM, true, true, server->path, NULL);
     if (server->fd < 0) {
         int fd = server->fd;
-        free(server->path);
-        free(server);
         fprintf(stderr, "Could not initialize vlog configuration socket: %s\n",
                 strerror(-server->fd));
+        free(server->path);
+        free(server);
         if (serverp) {
             *serverp = NULL; 
         }