Fixed bug where a freed structure was being derefenced
authorTheodore Tso <tytso@mit.edu>
Thu, 3 Jun 1993 11:42:29 +0000 (11:42 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 3 Jun 1993 11:42:29 +0000 (11:42 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2574 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/network.c

index 1bc15763154d540d2cf5fe095d1ed40e26702049..65e867f40a9d6a9f2471ecdc3a3d60cc5f802d5d 100644 (file)
@@ -204,17 +204,19 @@ process_packet(port_fd, prog, is_secondary)
     }
     cc = sendto(port_fd, response->data, response->length, 0,
                (struct sockaddr *)&saddr, saddr_len);
-    krb5_free_data(response);
     if (cc == -1) {
+        krb5_free_data(response);
        com_err(prog, errno, "while sending reply to %s/%d",
                inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
        return errno;
     }
     if (cc != response->length) {
+       krb5_free_data(response);
        com_err(prog, 0, "short reply write %d vs %d\n",
                response->length, cc);
        return KDC5_IO_RESPONSE;
     }
+    krb5_free_data(response);
     return 0;
 }