diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-07-07 09:42:59 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-07-12 10:18:07 +1000 |
commit | d5d6d4cd53659aef2c1db925c9150626a1d90770 (patch) | |
tree | 388f316d800274ee6f09c4de862e908013703107 /tools | |
parent | 26225f11df1713167e0bb835c840530706577964 (diff) |
Abort if zalloc ever fails
There's no guarantee that libinput does the right thing if memory allocation
fails and it's such a niche case on the systems we're targeting that it just
doesn't matter. Simply abort if zalloc ever fails.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libinput-measure-touchpad-tap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/libinput-measure-touchpad-tap.c b/tools/libinput-measure-touchpad-tap.c index 0b2b195f..ca361617 100644 --- a/tools/libinput-measure-touchpad-tap.c +++ b/tools/libinput-measure-touchpad-tap.c @@ -71,8 +71,9 @@ touch_tdelta_ms(const struct touch *t) static inline struct tap_data * tap_data_new(void) { - struct tap_data *tap_data = zalloc(sizeof(struct tap_data)); - assert(tap_data); + struct tap_data *tap_data; + + tap_data = zalloc(sizeof(struct tap_data)); return tap_data; } @@ -122,7 +123,6 @@ tap_data_duplicate_sorted(const struct tap_data *src, dest->toffset = src->toffset; dest->touches_sz = dest->count; dest->touches = zalloc(dest->count * sizeof(*dest->touches)); - assert(dest->touches); memcpy(dest->touches, src->touches, |