diff --git a/agent/command.c b/agent/command.c index b152a5ea4..417a8815f 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1170,6 +1170,8 @@ cmd_genkey (assuan_context_t ctx, char *line) int c; unsigned int flags = 0; + init_membuf (&outbuf, 512); + if (ctrl->restricted) return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN)); @@ -1227,8 +1229,6 @@ cmd_genkey (assuan_context_t ctx, char *line) if (rc) goto leave; - init_membuf (&outbuf, 512); - /* If requested, ask for the password to be used for the key. If this is not used the regular Pinentry mechanism is used. */ if (opt_inq_passwd && !(flags & GENKEY_FLAG_NO_PROTECTION))