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. */
| 3094 | * is incremented. The old command vector is freed, and the old objects |
| 3095 | * ref count is decremented. */ |
| 3096 | void rewriteClientCommandVector(client *c, int argc, ...) { |
| 3097 | va_list ap; |
| 3098 | int j; |
| 3099 | robj **argv; /* The new argument vector */ |
| 3100 | |
| 3101 | argv = zmalloc(sizeof(robj*)*argc); |
| 3102 | va_start(ap,argc); |
| 3103 | for (j = 0; j < argc; j++) { |
| 3104 | robj *a; |
| 3105 | |
| 3106 | a = va_arg(ap, robj*); |
| 3107 | argv[j] = a; |
| 3108 | incrRefCount(a); |
| 3109 | } |
| 3110 | replaceClientCommandVector(c, argc, argv); |
| 3111 | va_end(ap); |
| 3112 | } |
| 3113 | |
| 3114 | /* Completely replace the client command vector with the provided one. */ |
| 3115 | void replaceClientCommandVector(client *c, int argc, robj **argv) { |
no test coverage detected