projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovsdb: Drop write-only variable.
[openvswitch]
/
lib
/
stp.c
diff --git
a/lib/stp.c
b/lib/stp.c
index 87230bd9a27fd7c1979b38dc9982f5eaab45cc02..6fad3a08e1b8e267a2c1d28dc76fb91dfec9f4b4 100644
(file)
--- 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-214,7
+214,7
@@
stp_create(const char *name, stp_identifier bridge_id,
struct stp *stp;
struct stp_port *p;
struct stp *stp;
struct stp_port *p;
- stp = x
calloc(1,
sizeof *stp);
+ stp = x
zalloc(
sizeof *stp);
stp->name = xstrdup(name);
stp->bridge_id = bridge_id;
if (!(stp->bridge_id >> 48)) {
stp->name = xstrdup(name);
stp->bridge_id = bridge_id;
if (!(stp->bridge_id >> 48)) {
@@
-256,7
+256,10
@@
stp_create(const char *name, stp_identifier bridge_id,
void
stp_destroy(struct stp *stp)
{
void
stp_destroy(struct stp *stp)
{
- free(stp);
+ if (stp) {
+ free(stp->name);
+ free(stp);
+ }
}
/* Runs 'stp' given that 'ms' milliseconds have passed. */
}
/* Runs 'stp' given that 'ms' milliseconds have passed. */