Add close_file arg to saxdb_close_context(); allocate all saxdb contexts from heap.
[srvx.git] / src / modcmd.c
index cc298a9a0cced2bf94a08923bc9b3c89ffdd2fe9..7ae19af97739b126432fa2bf6415c2e7531526a6 100644 (file)
@@ -1835,15 +1835,13 @@ static MODCMD_FUNC(cmd_dump_messages) {
         return 0;
     }
     if ((res = setjmp(*saxdb_jmp_buf(ctx))) != 0) {
-        saxdb_close_context(ctx);
-        fclose(pf);
+        saxdb_close_context(ctx, 1);
         reply("MCMSG_MESSAGE_DUMP_FAILED", strerror(res));
         return 0;
     } else {
         for (it = dict_first(lang_C->messages); it; it = iter_next(it))
             saxdb_write_string(ctx, iter_key(it), iter_data(it));
-        saxdb_close_context(ctx);
-        fclose(pf);
+        saxdb_close_context(ctx, 1);
         reply("MCMSG_MESSAGES_DUMPED", fname);
         return 1;
     }