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:
parent
d25dada639
commit
11fda783f8
1 changed files with 0 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue