git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b2d06cb
)
stp: Fix memory leak.
author
Ben Pfaff
<blp@nicira.com>
Tue, 2 Feb 2010 22:03:36 +0000
(14:03 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Tue, 2 Feb 2010 23:21:09 +0000
(15:21 -0800)
Found with valgrind.
lib/stp.c
patch
|
blob
|
history
diff --git
a/lib/stp.c
b/lib/stp.c
index
cf1b2f9
..
6fad3a0
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.
@@
-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. */