diff options
author | Brian Lovin <brian.j.lovin@intel.com> | 2013-08-07 15:34:59 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-08-07 16:27:33 -0700 |
commit | bc91926e0cf2abe875c404b111dd08ad507d91a1 (patch) | |
tree | 1daee7d5ce38da5bcd9d11cd95af9c4e9292e63c /clients/keyboard.c | |
parent | 1c4f163c6d74c8aab69d2dbb9a03dc0e0e80f374 (diff) | |
download | weston-bc91926e0cf2abe875c404b111dd08ad507d91a1.tar.gz |
clients: use xmalloc in more places
For the clients continue to use xmalloc() to simplify OOM-handling.
Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
Diffstat (limited to 'clients/keyboard.c')
-rw-r--r-- | clients/keyboard.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clients/keyboard.c b/clients/keyboard.c index a2fbded5..5fe5d9d5 100644 --- a/clients/keyboard.c +++ b/clients/keyboard.c @@ -384,7 +384,7 @@ resize_handler(struct widget *widget, static char * insert_text(const char *text, uint32_t offset, const char *insert) { - char *new_text = malloc(strlen(text) + strlen(insert) + 1); + char *new_text = xmalloc(strlen(text) + strlen(insert) + 1); strncat(new_text, text, offset); new_text[offset] = '\0'; @@ -836,7 +836,7 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard layout = get_current_layout(virtual_keyboard); - keyboard = malloc(sizeof *keyboard); + keyboard = xmalloc(sizeof *keyboard); memset(keyboard, 0, sizeof *keyboard); keyboard->keyboard = virtual_keyboard; |