kernel/netgraph: Set resp to NULL if it is kfree()'d in the switch case.
authorSascha Wildner <saw@online.de>
Wed, 7 Dec 2011 21:11:09 +0000 (22:11 +0100)
committerSascha Wildner <saw@online.de>
Wed, 7 Dec 2011 21:11:09 +0000 (22:11 +0100)
This will prevent a later kfree() in the function from freeing it again.

sys/netgraph/ksocket/ng_ksocket.c

index dd9f317..1e23676 100644 (file)
@@ -809,6 +809,7 @@ ng_ksocket_rcvmsg(node_p node, struct ng_mesg *msg,
                        sopt.sopt_val = ksopt->value;
                        if ((error = sogetopt(so, &sopt)) != 0) {
                                kfree(resp, M_NETGRAPH);
+                               resp = NULL;
                                break;
                        }