X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=add.c;h=95f218943b5dcaab6540201e116fe57bce2e5608;hb=71b34cd785c3eef7b511e55397c556f5d52d01ae;hp=d820b528fe30b5b1011e7246a334fec67679223a;hpb=8e58a1769ce5e492dd68904dfc81b6e077fc2a3a;p=onak.git 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); }