DEVEL15-windows-server-xdr-free-20090614
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 19 Jun 2009 04:13:43 +0000 (04:13 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 19 Jun 2009 04:13:43 +0000 (04:13 +0000)
LICENSE MIT

when releasing the capabilities memory allocation use xdr_free() not
the free() of the afsd_service.exe module.

(cherry picked from commit 571dc5edbe76a7e62d47adee8df52bbf532c55bc)

src/WINNT/afsd/cm_server.c

index 545f686..a7aea33 100644 (file)
@@ -117,7 +117,7 @@ cm_PingServer(cm_server_t *tsp)
        /* we currently handle 32-bits of capabilities */
        if (caps.Capabilities_len > 0) {
            tsp->capabilities = caps.Capabilities_val[0];
-           free(caps.Capabilities_val);
+           xdr_free(caps.Capabilities_val, caps.Capabilities_len);
            caps.Capabilities_len = 0;
            caps.Capabilities_val = 0;
        } else {
@@ -380,7 +380,7 @@ static void cm_CheckServersMulti(afs_uint32 flags, cm_cell_t *cellp)
                 /* we currently handle 32-bits of capabilities */
                 if (caps[i].Capabilities_len > 0) {
                     tsp->capabilities = caps[i].Capabilities_val[0];
-                    free(caps[i].Capabilities_val);
+                    xdr_free(caps[i].Capabilities_val, caps[i].Capabilities_len);
                     caps[i].Capabilities_len = 0;
                     caps[i].Capabilities_val = 0;
                 } else {