Skip to content

Commit d6e72f4

Browse files
authored
fix: nil pointer dereference when selecting database
Prior to this commit the fact of selecting which redis database to dump when making use of the option `-db {redis_db}` would yield a nil pointer de-reference error due do the fact that a nil pointer can not be de-referenced even if it is an assignment expression.
1 parent 969d7ce commit d6e72f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func realMain() int {
103103
return 1
104104
}
105105
} else {
106-
var db *uint8 = nil
106+
var db *uint8 = new(uint8)
107107
if c.Db != -1 {
108108
*db = uint8(c.Db)
109109
}

0 commit comments

Comments
 (0)