Fix a memory leak in the NFS-over-UDP code.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Mon, 26 Apr 2010 05:38:27 +0000 (22:38 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Mon, 26 Apr 2010 05:38:27 +0000 (22:38 -0700)
The TCP code still has a per-connection leak, but at least this should help
with the UDP per-request leak.

nfs3/rpc.c

index 5341f20..f753bd1 100644 (file)
@@ -173,6 +173,7 @@ async_rpc_send_failure(RPCRequest *req, enum accept_stat stat)
         /* For UDP, a connection only exists for the duration of a single
          * message. */
         g_mutex_free(req->connection->send_lock);
+        g_string_free(req->connection->msgbuf, TRUE);
         g_string_free(req->connection->sendbuf, TRUE);
         g_free(req->connection);
     }
@@ -250,6 +251,7 @@ async_rpc_send_reply(RPCRequest *req, void *result)
         /* For UDP, a connection only exists for the duration of a single
          * message. */
         g_mutex_free(req->connection->send_lock);
+        g_string_free(req->connection->msgbuf, TRUE);
         g_string_free(req->connection->sendbuf, TRUE);
         g_free(req->connection);
     }