diff options
author | antirez <antirez@gmail.com> | 2013-03-06 12:19:38 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-03-06 12:21:31 +0100 |
commit | 4ea89e64c03e33ef9f1f2b338fa654f15e5a7f52 (patch) | |
tree | 2840a06fcd5421394eb97089c70f979e0d611ec1 /src/sds.c | |
parent | 5cabae84e60fa4b9ae0de00984ad0e9c08190532 (diff) | |
download | redis-4ea89e64c03e33ef9f1f2b338fa654f15e5a7f52.tar.gz |
sdssplitargs(): on error set *argc to 0.
This makes programs not checking the return value for NULL much safer
since with this change:
1) It is still possible to iterate the zero-length result without
crashes.
2) sdssplitargs_free will work against NULL and 0 count.
Diffstat (limited to 'src/sds.c')
-rw-r--r-- | src/sds.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -593,6 +593,7 @@ err: sdsfree(vector[*argc]); zfree(vector); if (current) sdsfree(current); + *argc = 0; return NULL; } |