X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fstp.c;h=38885c07f666e472ce4691988863e7df7879e991;hb=26ad129e69fc7c800630dbd541dc2dcc8150c3a4;hp=cf1b2f981c559d139ffcb3439f1e3430587d7662;hpb=ec6fde61c85ff6a57b05d422a9d8b5ef679ad928;p=openvswitch diff --git a/lib/stp.c b/lib/stp.c index cf1b2f98..38885c07 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. @@ -18,6 +18,8 @@ * applies to all modifications. */ #include "stp.h" +#include +#include #include #include #include @@ -256,7 +258,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. */