File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -773,10 +773,10 @@ int valkeyReconnect(valkeyContext *c) {
773773 memset (c -> errstr , '\0' , strlen (c -> errstr ));
774774
775775 assert (c -> funcs );
776- if (c -> funcs -> close )
776+ if (c -> funcs && c -> funcs -> close )
777777 c -> funcs -> close (c );
778778
779- if (c -> privctx && c -> funcs -> free_privctx ) {
779+ if (c -> privctx && c -> funcs && c -> funcs -> free_privctx ) {
780780 c -> funcs -> free_privctx (c -> privctx );
781781 c -> privctx = NULL ;
782782 }
@@ -810,11 +810,13 @@ int valkeyReconnect(valkeyContext *c) {
810810 return VALKEY_ERR ;
811811 }
812812
813- if (c -> funcs -> connect (c , & options ) != VALKEY_OK ) {
813+ if (c -> funcs && c -> funcs -> connect &&
814+ c -> funcs -> connect (c , & options ) != VALKEY_OK ) {
814815 return VALKEY_ERR ;
815816 }
816817
817- if (c -> command_timeout != NULL && (c -> flags & VALKEY_BLOCK ) && c -> fd != VALKEY_INVALID_FD ) {
818+ if (c -> command_timeout != NULL && (c -> flags & VALKEY_BLOCK ) &&
819+ c -> fd != VALKEY_INVALID_FD && c -> funcs && c -> funcs -> set_timeout ) {
818820 c -> funcs -> set_timeout (c , * c -> command_timeout );
819821 }
820822
You can’t perform that action at this time.
0 commit comments