diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2013-01-26 11:18:45 -0800 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2013-01-26 11:18:45 -0800 |
commit | f05909cd53b1c0f983e2d645205d036784f0b39b (patch) | |
tree | 8738a33e728a53c7b521f2f87bec569245650fc3 /README.md | |
parent | 9df327e8fddef1e17b2136b5f42be58f46cdbc08 (diff) | |
parent | d7e3268f48b457cb52336d264f8860b336faea9f (diff) |
Merge pull request #147 from hdoreau/d7e3268f48b457cb52336d264f8860b336faea9f
Prevent hiredis from crashing on memory allocation failure
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -44,7 +44,7 @@ After trying to connect to Redis using `redisConnect` you should check the `err` field to see if establishing the connection was successful: redisContext *c = redisConnect("127.0.0.1", 6379); - if (c->err) { + if (c != NULL && c->err) { printf("Error: %s\n", c->errstr); // handle error } |