From 11fda783f85e1f6027c997c6b044c65288c89099 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 14 Sep 2015 14:16:48 -0400 Subject: [PATCH] Remove unnecessary check for nil CString @noxiouz points out that we don't need to check for a nil result from C.CString(), since an out-of-memory condition causes a runtime panic instead. Signed-off-by: Nalin Dahyabhai (github: nalind) --- daemon/logger/journald/read.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/daemon/logger/journald/read.go b/daemon/logger/journald/read.go index c6315e0b92..80c1fbda7a 100644 --- a/daemon/logger/journald/read.go +++ b/daemon/logger/journald/read.go @@ -220,10 +220,6 @@ func (s *journald) readLogs(logWatcher *logger.LogWatcher, config logger.ReadCon } // Add a match to have the library do the searching for us. cmatch = C.CString("CONTAINER_ID_FULL=" + s.vars["CONTAINER_ID_FULL"]) - if cmatch == nil { - logWatcher.Err <- fmt.Errorf("error reading container ID") - return - } defer C.free(unsafe.Pointer(cmatch)) rc = C.sd_journal_add_match(j, unsafe.Pointer(cmatch), C.strlen(cmatch)) if rc != 0 {