- if(name)
- xasprintf(&filename, "%s/hosts/%s", confbase, name);
- else
- xasprintf(&filename, "%s/rsa_key.pub", confbase);
+ char *name = get_name();
+
+ if(name) {
+ xasprintf(&pubname, "%s/hosts/%s", confbase, name);
+ free(name);
+ } else {
+ xasprintf(&pubname, "%s/rsa_key.pub", confbase);
+ }