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.
[openvswitch]
/
ovsdb
/
file.c
diff --git
a/ovsdb/file.c
b/ovsdb/file.c
index c51f75290040d817076ab7289bb443db0231a730..43fcb95643e93f387e69a2fb21887099a2a97f5e 100644
(file)
--- a/
ovsdb/file.c
+++ b/
ovsdb/file.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009, 2010, 2011 Nicira, Inc.
+/* Copyright (c) 2009, 2010, 2011
, 2012
Nicira, Inc.
*
* 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.
@@
-531,11
+531,14
@@
ovsdb_file_create(struct ovsdb *db, struct ovsdb_log *log,
{
long long int now = time_msec();
struct ovsdb_file *file;
{
long long int now = time_msec();
struct ovsdb_file *file;
+ char *deref_name;
char *abs_name;
/* Use the absolute name of the file because ovsdb-server opens its
* database before daemonize() chdirs to "/". */
char *abs_name;
/* Use the absolute name of the file because ovsdb-server opens its
* database before daemonize() chdirs to "/". */
- abs_name = abs_file_name(NULL, file_name);
+ deref_name = follow_symlinks(file_name);
+ abs_name = abs_file_name(NULL, deref_name);
+ free(deref_name);
if (!abs_name) {
*filep = NULL;
return ovsdb_io_error(0, "could not determine current "
if (!abs_name) {
*filep = NULL;
return ovsdb_io_error(0, "could not determine current "
@@
-646,7
+649,7
@@
ovsdb_file_compact(struct ovsdb_file *file)
/* Lock temporary file. */
tmp_name = xasprintf("%s.tmp", file->file_name);
/* Lock temporary file. */
tmp_name = xasprintf("%s.tmp", file->file_name);
- retval = lockfile_lock(tmp_name,
0,
&tmp_lock);
+ retval = lockfile_lock(tmp_name, &tmp_lock);
if (retval) {
error = ovsdb_io_error(retval, "could not get lock on %s", tmp_name);
goto exit;
if (retval) {
error = ovsdb_io_error(retval, "could not get lock on %s", tmp_name);
goto exit;