Commit 9fea57e
cachedb_memcached: fix NULL deref when memcached_create() returns NULL
memcached_create(NULL) can return NULL on allocation failure. The existing
code never checks the return value, so a NULL memc pointer falls through to
memcached_server_push(NULL, ...) which dereferences the NULL pointer.
Add an explicit NULL check after memcached_create(), following the existing
error-handling pattern in the function (pkg_free + return 0).
Found during a systematic audit of cachedb backends following the
cachedb_redis NULL-deref fix in commit 8fb569c.1 parent 82e242e commit 9fea57e
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
| |||
0 commit comments