X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/8e58a1769ce5e492dd68904dfc81b6e077fc2a3a..42dbc6b5efa87e868116549c5932ab62cf716568:/add.c 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); }