floppy: Don't leak string along error path
commit18e1504d0bf9871c1414e5d8d51eeb521469b5ce
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 12 Jul 2022 17:48:40 +0000 (12 18:48 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 12 Jul 2022 17:50:39 +0000 (12 18:50 +0100)
treed15f6e525302dc1654f76dbd53f392926f11afde
parent694effecfaed5b83af0f36b487495dac9e7d860d
floppy: Don't leak string along error path

Found by Coverity:

  Error: CLANG_WARNING: [#def161]
  nbdkit-1.30.7/plugins/floppy/virtual-floppy.c:432:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_file.name'
  #  430|     fi = floppy->files.len;
  #  431|     if (files_append (&floppy->files, new_file) == -1) {
  #  432|->     nbdkit_error ("realloc: %m");
  #  433|       free (host_path);
  #  434|       return -1;

I should note this is not a real problem.  If this code fails (during
floppy disk creation) we will eventually exit with an error.
plugins/floppy/virtual-floppy.c