fixed manifest structure leak when failing to write a manifest.

This commit is contained in:
gardners 2012-05-21 22:41:13 +09:30
parent 322806a150
commit 3164a76b1e

View File

@ -521,6 +521,7 @@ int rhizome_fetch_poll()
char filename[1024];
if (!FORM_RHIZOME_DATASTORE_PATH(filename,"import/manifest.%s", id))
return -1;
snprintf(filename,1024,"%s/manifest.%s",rhizome_datastore_path(),id);
/* Do really write the manifest unchanged */
if (debug&DEBUG_RHIZOME) {
fprintf(stderr,"manifest has %d signatories\n",q->manifest->sig_count);
@ -540,6 +541,10 @@ int rhizome_fetch_poll()
1 /* do check hash of file */,
0 /* do not sign it, just keep existing signatures */);
q->manifest=NULL;
} else {
WHY("rhizome_write_manifest_file() failed");
rhizome_manifest_free(q->manifest);
q->manifest=NULL;
}
}
}