Rewrite the command vector of the client. All the new objects ref count * is incremented. The old command vector is freed, and the old objects * ref count is decremented. */
| 3731 | * is incremented. The old command vector is freed, and the old objects |
| 3732 | * ref count is decremented. */ |
| 3733 | void rewriteClientCommandVector(client *c, int argc, ...) { |
| 3734 | va_list ap; |
| 3735 | int j; |
| 3736 | robj **argv; /* The new argument vector */ |
| 3737 | |
| 3738 | argv = (robj**)zmalloc(sizeof(robj*)*argc, MALLOC_LOCAL); |
| 3739 | va_start(ap,argc); |
| 3740 | for (j = 0; j < argc; j++) { |
| 3741 | robj *a; |
| 3742 | |
| 3743 | a = va_arg(ap, robj*); |
| 3744 | argv[j] = a; |
| 3745 | incrRefCount(a); |
| 3746 | } |
| 3747 | replaceClientCommandVector(c, argc, argv); |
| 3748 | va_end(ap); |
| 3749 | } |
| 3750 | |
| 3751 | /* Completely replace the client command vector with the provided one. */ |
| 3752 | void replaceClientCommandVector(client *c, int argc, robj **argv) { |
no test coverage detected