about summary refs log tree commit diff
path: root/src/settings/plugins/ifcfg-rh/shvar.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-05-08 21:40:53 +0200
committerMichael Biebl <biebl@debian.org>2020-05-08 21:40:53 +0200
commitd460892bbfece74fb6d3cd846bf6ef548290be41 (patch)
tree0474e5be0b5e5fac0d2f3a1e554382e8d1aa6397 /src/settings/plugins/ifcfg-rh/shvar.c
parent1e5977b62f896e844b548c3007ace9e1dfa7f9ed (diff)
New upstream version 1.24.0 upstream/1.24.0
Diffstat (limited to 'src/settings/plugins/ifcfg-rh/shvar.c')
-rw-r--r--src/settings/plugins/ifcfg-rh/shvar.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c
index f2a1dd78..cd63661d 100644
--- a/src/settings/plugins/ifcfg-rh/shvar.c
+++ b/src/settings/plugins/ifcfg-rh/shvar.c
@@ -1492,6 +1492,13 @@ svWriteFile (shvarFile *s, int mode, GError **error)
 			return FALSE;
 		}
 		f = fdopen (tmpfd, "w");
+		if (!f) {
+			errsv = errno;
+			g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errsv),
+			             "Internal error writing file '%s': %s",
+			             s->fileName, nm_strerror_native (errsv));
+			return FALSE;
+		}
 		fseek (f, 0, SEEK_SET);
 		c_list_for_each (current, &s->lst_head) {
 			const shvarLine *line = c_list_entry (current, shvarLine, lst);