Commit Diff


commit - 89b2760ef192a744e09a41a8af347aa148bbdf33
commit + f67e047aa9cf27e3dd75f85bdffd87de22386fc9
blob - 2963f8595c2e31d471a0c8c736947283a70cba25
blob + de8ac167b4c66fe2db14302f9de000f917da9148
--- src/lib/core/say.c
+++ src/lib/core/say.c
@@ -627,23 +627,12 @@ log_syslog_init(struct log *log, const char *init_str)
 		return -1;
 
 	log->syslog_server_type = opts.server_type;
-	if (log->syslog_server_type != SAY_SYSLOG_DEFAULT) {
-		log->path = strdup(opts.server_path);
-		if (log->path == NULL) {
-			diag_set(OutOfMemory, strlen(opts.server_path),
-				 "malloc", "server address");
-			return -1;
-		}
-	}
-	if (opts.identity == NULL)
-		log->syslog_ident = strdup("tarantool");
+	if (log->syslog_server_type != SAY_SYSLOG_DEFAULT)
+		log->path = xstrdup(opts.server_path);
+	if (opts.identity == NULL)
+		log->syslog_ident = xstrdup("tarantool");
 	else
-		log->syslog_ident = strdup(opts.identity);
-	if (log->syslog_ident == NULL) {
-		diag_set(OutOfMemory, strlen(opts.identity), "malloc",
-		         "log->syslog_ident");
-		return -1;
-	}
+		log->syslog_ident = xstrdup(opts.identity);
 
 	if (opts.facility == syslog_facility_MAX)
 		log->syslog_facility = SYSLOG_LOCAL7;