X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/8e58a1769ce5e492dd68904dfc81b6e077fc2a3a..a953676d714ba11d3b9509bbea747ad0858b28ba:/add.c?ds=inline diff --git a/add.c b/add.c index d820b52..95f2189 100644 --- a/add.c +++ b/add.c @@ -51,11 +51,19 @@ int main(int argc, char *argv[]) for (i = 0; params != NULL && params[i] != NULL; i += 2) { if (!strcmp(params[i], "keytext")) { ctx.buffer = params[i+1]; + } else { + free(params[i+1]); } + params[i+1] = NULL; + free(params[i]); + params[i] = NULL; + } + if (params != NULL) { + free(params); + params = NULL; } - puts("Content-Type: text/html\n"); - puts("onak : Add"); + start_html("onak : Add"); if (ctx.buffer == NULL) { puts("Error: No keytext to add supplied."); } else { @@ -66,12 +74,12 @@ int main(int argc, char *argv[]) parse_keys(packets, &keys); initdb(); printf("Got %d new keys.\n", - update_keys(&keys)); + update_keys(&keys, false)); cleanupdb(); } else { puts("No OpenPGP packets found in input."); } } - puts(""); + end_html(); return (EXIT_SUCCESS); }