]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commitdiff
Free memory in correct fail path
authorOwen Smith <owen.smith@citrix.com>
Mon, 30 Jan 2023 14:54:38 +0000 (14:54 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Tue, 14 Feb 2023 17:56:52 +0000 (17:56 +0000)
SDV identifies this as an error. Only attempt to free the buffer after the
allocation succeeds.

Signed-off-by: Matthew Sykes <matthew.sykes@citrix.com>
Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xenvbd/base64.c

index 223579a495283b5aa26d94dc2dff6b96980e90b6..427a98a217ddbeaccf0ab1aac8f38e1acc39af3e 100644 (file)
@@ -157,9 +157,9 @@ fail4:
     Error("fail4\n");
 fail3:
     Error("fail3\n");
+    Base64Free(Buffer);
 fail2:
     Error("fail2\n");
-    Base64Free(Buffer);
 fail1:
     Error("fail1 %08x\n", status);
     *Binary = NULL;