Dont leak every single buffer we read from the socket.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 31 Oct 2013 01:15:03 +0000 (18:15 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 31 Oct 2013 01:15:03 +0000 (18:15 -0700)
lib/socket.c

index c5068bae24ea754e4bbbf787a2fa44ca17d721e6..762dbfac2fc5d5ff092b5ade6a205d0900f6933e 100644 (file)
@@ -266,7 +266,7 @@ static int rpc_read_from_socket(struct rpc_context *rpc)
                        rpc_set_error(rpc, "Invalid/garbage pdu received from server. Closing socket");
                        return -1;
                }
-               free(rpc->inbuf);
+               free(buf);
        }
 
        return 0;