]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix minor leak in gssrpc UDP cache code 799/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 19 Jun 2018 17:15:15 +0000 (13:15 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 20 Jun 2018 15:16:44 +0000 (11:16 -0400)
In svc_udp.c:cache_set(), if victim is allocated successfully but
allocation for newbuf fails, free victim before returning.  Reported
by Bean Zhang.

ticket: 8703

src/lib/rpc/svc_udp.c

index d3140df6bc0b47f29835d529aed57be5d424631c..8ecbdf2b33d1c6c2638f74460404c208f3fe74db 100644 (file)
@@ -479,6 +479,7 @@ cache_set(
                newbuf = mem_alloc(su->su_iosz);
                if (newbuf == NULL) {
                        CACHE_PERROR("cache_set: could not allocate new rpc_buffer");
+                       free(victim);
                        return;
                }
        }