Fix crash with subkey expire

Former-commit-id: 8e1d416714484ff6ff4242c5d9a24b1458bbfb7b
This commit is contained in:
John Sully 2020-01-03 17:06:07 -05:00
parent 4301cfb8e9
commit efdf09be36

View File

@ -178,6 +178,8 @@ sds sdsdup(const char *s) {
} }
sds sdsdupshared(const char *s) { sds sdsdupshared(const char *s) {
if (s == NULL)
return NULL;
unsigned char flags = s[-1]; unsigned char flags = s[-1];
if ((flags & SDS_TYPE_MASK) != SDS_TYPE_REFCOUNTED) if ((flags & SDS_TYPE_MASK) != SDS_TYPE_REFCOUNTED)
return sdsnewlen(s, -sdslen(s)); return sdsnewlen(s, -sdslen(s));