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("<html><title>onak : Add</title><body>");
+ start_html("onak : Add");
if (ctx.buffer == NULL) {
puts("Error: No keytext to add supplied.");
} else {
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("</body></html>");
+ end_html();
return (EXIT_SUCCESS);
}