[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Free memory in correct fail path


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 30 Jan 2023 14:54:38 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>, Matthew Sykes <matthew.sykes@xxxxxxxxxx>
  • Delivery-date: Mon, 30 Jan 2023 14:54:54 +0000
  • Ironport-data: A9a23:wVhifq2TJ4Neb+ma8vbD5aRxkn2cJEfYwER7XKvMYLTBsI5bpzIAz 2QZDGyHb/7YYWWgfI13bo/j/RsPv5Tdz4djHlZtpC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK5ULSfUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS93uDgNyo4GlD5gVlPagR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfIktqq tw7KSg3TS+jreWLkOOdZdY3r5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGcxKk2aOHWjOX9OYH46tOC3i3+5aDhZtFK9rqsr+WnDigd21dABNfKEJ4bWG5QEzi50o ErU71j5PzUhc+azkxyM+XfwpeWIjDvkDdd6+LqQqacx3Qz7KnYoIAIXUx6jv7y1h1CzX/pbK lcI4Ww+oK4q7kupQ9LhGRqirxa5UgU0AoQKVbdgsUfUl/SSulzCboQZctJfQP8MkJAWZj0y7 Hy2v/nuOGw+lpKqElvIo994sgiOESQSKGYDYwoNQg0E/8TvrekPs/7fcjpwOPXr14OoQFkc1 xjP9XFj3OtL0abnwo3hpTj6bySQSo8lp+LfziHeRSqb4wxwf+ZJjKT4uAGAvZ6swGt0J2RtX UToeeDEt4ji7rnXzkRhpdnh+5n0j8tpyBWG3TZS82AJrlxBAUKLc4FK+y1ZL0x0KMsCcjKBS BaN5l4JvcAKbCfyPPAfj2eN5yMClPiIKDgYfqqMMoomjmZZK2drAx2ClWbPhjuwwSDAYIk0O IuBcNbEMJrpIf0P8dZCfM9EieVD7nlnlQvuqWXTk0zPPUy2OCTEFt/o8TKmMogE0U9ziF6Lr 4kOZ5fakkU3vS+XSnC/zLP/5GsidRATba0aYeQOHgJfCmKKwF0cNsI=
  • Ironport-hdrordr: A9a23:1fGmSatLYqzHtxI/WOGFIDWE7skDstV00zEX/kB9WHVpm6yj+v xG/c5rsCMc7Qx6ZJhOo7+90cW7L080lqQFg7X5X43DYOCOggLBQL2KhbGI/9SKIVycygcy78 Zdm6gVMqyLMbB55/yKnTVRxbwbsaW6GKPDv5ag8590JzsaD52Jd21Ce36m+ksdfnggObMJUK Cyy+BgvDSadXEefq2AdwI4t7iqnaysqHr+CyR2fiIa1A==
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

SDV identifies this as an error. Only attempt to free the buffer after the
allocation succeeds.

Signed-off-by: Matthew Sykes <matthew.sykes@xxxxxxxxxx>
Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvbd/base64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenvbd/base64.c b/src/xenvbd/base64.c
index 223579a..427a98a 100644
--- a/src/xenvbd/base64.c
+++ b/src/xenvbd/base64.c
@@ -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;
-- 
2.39.0.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.