summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2022-05-27 16:34:35 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2022-05-27 16:34:35 +0000
commit557fa9e635372972be6534ed2688ff1d60fc717c (patch)
tree6429809dc8c34108f9517950744a3300d08cba12
parentb88bb1b2c85d91f3163c01fa8647ae6f8a7137f4 (diff)
Do not free() an on-stack array.
Reported by Tobias Nygren using gcc10.
-rw-r--r--driver/xf86-input-ws/src/ws.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/driver/xf86-input-ws/src/ws.c b/driver/xf86-input-ws/src/ws.c
index ac62b5e0d..842007e89 100644
--- a/driver/xf86-input-ws/src/ws.c
+++ b/driver/xf86-input-ws/src/ws.c
@@ -13,7 +13,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $OpenBSD: ws.c,v 1.66 2021/03/28 15:57:45 jcs Exp $ */
+/* $OpenBSD: ws.c,v 1.67 2022/05/27 16:34:34 matthieu Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -403,10 +403,8 @@ wsDeviceInit(DeviceIntPtr pWS)
xf86InitValuatorAxisStruct(pWS, VSCROLL_AXIS,
axes_labels[VSCROLL_AXIS], 0, -1, 0, 0, 0, Relative);
priv->scroll_mask = valuator_mask_new(MAX_VALUATORS);
- if (!priv->scroll_mask) {
- free(axes_labels);
+ if (!priv->scroll_mask)
return !Success;
- }
/*
* The value of an HSCROLL or VSCROLL event is the fraction