Fix a memory leak in the NFS-over-UDP code.
[bluesky.git] / 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);
     }