X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstp.c;h=6fad3a08e1b8e267a2c1d28dc76fb91dfec9f4b4;hb=abaad8cf1b5089e17a4af0ab1ff644bfcf63cad9;hp=cf1b2f981c559d139ffcb3439f1e3430587d7662;hpb=58fda1dab104041fc693032475ec4662c1a52849;p=openvswitch diff --git a/lib/stp.c b/lib/stp.c index cf1b2f98..6fad3a08 100644 --- a/lib/stp.c +++ b/lib/stp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -256,7 +256,10 @@ stp_create(const char *name, stp_identifier bridge_id, void stp_destroy(struct stp *stp) { - free(stp); + if (stp) { + free(stp->name); + free(stp); + } } /* Runs 'stp' given that 'ms' milliseconds have passed. */