| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Memcached
Revision: 787
Author: dormando
Date: 23 Jun 2008 00:05:23
Changes:Allocate new conn structures with calloc.
Janusz Dziemidowicz reported conn->next was sometimes not initialized.
This would have been the case for any client connection, or any
listener connection that wasn't tcp.
| ... | ...@@ -297,8 +297,8 @@ | |
| 297 | 297 | conn *c = conn_from_freelist(); |
| 298 | 298 | |
| 299 | 299 | if (NULL == c) { |
| 300 | if (!(c = (conn *)malloc(sizeof(conn)))) { | |
| 301 | fprintf(stderr, "malloc()\n"); | |
| 300 | if (!(c = (conn *)calloc(1, sizeof(conn)))) { | |
| 301 | fprintf(stderr, "calloc()\n"); | |
| 302 | 302 | return NULL; |
| 303 | 303 | } |
| 304 | 304 | c->rbuf = c->wbuf = 0; |