1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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 <nalin@redhat.com> (github: nalind)
This commit is contained in:
Nalin Dahyabhai 2015-09-14 14:16:48 -04:00
parent d25dada639
commit 11fda783f8

View file

@ -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 {