s3: Fix a NULL pointer dereference