r9685: Add tests for samba3sam mapping module
[sfrench/samba-autobuild/.git] / source4 / lib / ldb / tools / cmdline.c
index cde357a0882346984ac12e89f982d9363c18ecd8..fb0292b7d9ea8c6b9be43916e280b386ee65b0ce 100644 (file)
@@ -124,13 +124,14 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const
 
                case 'o':
                        options.options = talloc_realloc(ret, options.options, 
-                                                        const char *, num_options+2);
+                                                        const char *, num_options+3);
                        if (options.options == NULL) {
                                ldb_oom(ldb);
                                goto failed;
                        }
-                       options.options[num_options++] = poptGetOptArg(pc);
+                       options.options[num_options] = poptGetOptArg(pc);
                        options.options[num_options+1] = NULL;
+                       num_options++;
                        break;
                        
                default: