NetworkManager r4201 - in trunk: . src
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r4201 - in trunk: . src
- Date: Tue, 21 Oct 2008 17:56:46 +0000 (UTC)
Author: dcbw
Date: Tue Oct 21 17:56:46 2008
New Revision: 4201
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4201&view=rev
Log:
2008-10-21 Dan Williams <dcbw redhat com>
* src/NetworkManagerPolicy.c
- (update_etc_hosts): don't leak errors, and ensure that
g_file_set_contents() gets a valid error placeholder (rh #461933)
Modified:
trunk/ChangeLog
trunk/src/NetworkManagerPolicy.c
Modified: trunk/src/NetworkManagerPolicy.c
==============================================================================
--- trunk/src/NetworkManagerPolicy.c (original)
+++ trunk/src/NetworkManagerPolicy.c Tue Oct 21 17:56:46 2008
@@ -266,6 +266,8 @@
nm_warning ("%s: couldn't read " SYSCONFDIR "/hosts: (%d) %s",
__func__, error ? error->code : 0,
(error && error->message) ? error->message : "(unknown)");
+ if (error)
+ g_error_free (error);
} else {
lines = g_strsplit_set (contents, "\n\r", 0);
g_free (contents);
@@ -312,10 +314,13 @@
g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost");
}
+ error = NULL;
if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) {
nm_warning ("%s: couldn't update " SYSCONFDIR "/hosts: (%d) %s",
__func__, error ? error->code : 0,
(error && error->message) ? error->message : "(unknown)");
+ if (error)
+ g_error_free (error);
} else
success = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]