Skip to content

Commit

Permalink
Don't double free the cache key
Browse files Browse the repository at this point in the history
Addresses #1591
  • Loading branch information
michael-grunder committed Jul 17, 2019
1 parent 148bf37 commit cb5d6b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cluster_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,8 @@ cluster_free(redisCluster *c, int free_ctx)
if (c->cache_key) {
if (c->redirections) {
zend_hash_del(&EG(persistent_list), c->cache_key);
c->cache_key = NULL;
}
zend_string_release(c->cache_key);
}

/* Free structure itself */
Expand Down
6 changes: 4 additions & 2 deletions redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,10 @@ free_reply_callbacks(RedisSock *redis_sock)

/* Passthru for destroying cluster cache */
static void cluster_cache_dtor(zend_resource *rsrc) {
redisCachedCluster *rcc = (redisCachedCluster*)rsrc->ptr;
cluster_cache_free(rcc);
if (rsrc->ptr) {
redisCachedCluster *rcc = (redisCachedCluster*)rsrc->ptr;
cluster_cache_free(rcc);

This comment has been minimized.

Copy link
@yatsukhnenko

yatsukhnenko Jul 17, 2019

Member

@michael-grunder cluster_cache_free(rsrc->ptr)

}
}

void
Expand Down

0 comments on commit cb5d6b9

Please sign in to comment.