Przeglądaj źródła

Fix crash in parser.

(Logical change 1.98)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@357 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 21 lat temu
rodzic
commit
e443ea67c2
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      exec/parse.c

+ 4 - 4
exec/parse.c

@@ -427,9 +427,8 @@ extern int openais_main_config_read (char **error_string,
 	openais_config->interfaces = malloc (sizeof (struct gmi_interface) * interface_max);
 	if (openais_config->interfaces == 0) {
 		parse_done = 1;
-		
-		error_reason = "Out of memory trying to allocate ethernet interface storage area";
-		goto parse_error;
+		*error_string = "Out of memory trying to allocate ethernet interface storage area";
+		return -1;
 	}
 
 	memset (openais_config->interfaces, 0,
@@ -440,7 +439,8 @@ extern int openais_main_config_read (char **error_string,
 	if (fp == 0) {
 		parse_done = 1;
 		sprintf (error_reason, "Can't read file reason = %s", strerror (errno));
-		goto parse_error;
+		*error_string = error_reason;
+		return -1;
 	}
 
 	while (fgets (line, 255, fp)) {