projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovsdb-idl: Fix memory leak committing a no-op transaction.
[openvswitch]
/
lib
/
shash.c
diff --git
a/lib/shash.c
b/lib/shash.c
index e6cb6b0db8eccfe4cad50c7b7076b9bd1cbc7192..5257de12aad4c4df7acb03809224e1e0bdd70e0c 100644
(file)
--- a/
lib/shash.c
+++ b/
lib/shash.c
@@
-76,6
+76,17
@@
shash_add(struct shash *sh, const char *name, const void *data)
return node;
}
return node;
}
+bool
+shash_add_once(struct shash *sh, const char *name, const void *data)
+{
+ if (!shash_find(sh, name)) {
+ shash_add(sh, name, data);
+ return true;
+ } else {
+ return false;
+ }
+}
+
void
shash_delete(struct shash *sh, struct shash_node *node)
{
void
shash_delete(struct shash *sh, struct shash_node *node)
{