projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mention that /dev/urandom is needed.
[openvswitch]
/
lib
/
stp.c
diff --git
a/lib/stp.c
b/lib/stp.c
index 5d35156acb7ccef49e2be0f097fbc1a691ff4f3a..38885c07f666e472ce4691988863e7df7879e991 100644
(file)
--- a/
lib/stp.c
+++ b/
lib/stp.c
@@
-216,7
+216,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)) {
@@
-258,7
+258,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. */