Don't assume no padding or specific ordering in moduleLoadQueueEntry structure.

We need to be free to shuffle fields or add more fields in a structure
without breaking code.

Related to issue #3293.
This commit is contained in:
antirez 2016-06-13 09:51:06 +02:00
parent 9a02dac2e8
commit a4bce77e92
2 changed files with 4 additions and 3 deletions

View File

@ -154,10 +154,11 @@ void resetServerSaveParams(void) {
}
void queueLoadModule(sds path, sds *argv, int argc) {
struct moduleLoadQueueEntry *loadmod =
zmalloc(sizeof(struct moduleLoadQueueEntry)+sizeof(robj*)*argc);
int i;
struct moduleLoadQueueEntry *loadmod;
loadmod = zmalloc(sizeof(struct moduleLoadQueueEntry));
loadmod->argv = zmalloc(sizeof(robj*)*argc);
loadmod->path = sdsnew(path);
loadmod->argc = argc;
for (i = 0; i < argc; i++) {

View File

@ -686,7 +686,7 @@ struct saveparam {
struct moduleLoadQueueEntry {
sds path;
int argc;
robj *argv[];
robj **argv;
};
struct sharedObjectsStruct {