projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovs-openflowd: Remove documentation for obsolete --mgmt-id option.
[openvswitch]
/
lib
/
stp.c
diff --git
a/lib/stp.c
b/lib/stp.c
index 87230bd9a27fd7c1979b38dc9982f5eaab45cc02..38885c07f666e472ce4691988863e7df7879e991 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.
@@
-18,6
+18,8
@@
* applies to all modifications. */
#include "stp.h"
* applies to all modifications. */
#include "stp.h"
+#include <sys/types.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include <assert.h>
#include <inttypes.h>
@@
-214,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)) {
@@
-256,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. */