libstand: Add a missing free() in an error path.
authorSascha Wildner <saw@online.de>
Tue, 19 Aug 2014 20:10:10 +0000 (22:10 +0200)
committerSascha Wildner <saw@online.de>
Tue, 19 Aug 2014 20:11:30 +0000 (22:11 +0200)
lib/libstand/tftp.c

index 7c9af52..be7f098 100644 (file)
@@ -280,8 +280,10 @@ tftp_open(const char *path, struct open_file *f)
                return (ENOMEM);
 
        tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
-       if (io == NULL)
+       if (io == NULL) {
+               free(tftpfile);
                return (EINVAL);
+       }
 
        io->destip = servip;
        tftpfile->off = 0;