summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2024-01-17 13:48:07 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2024-01-17 14:14:57 +0900
commitb5c5c305e3c123948fd43c8b348c08e6aac9055e (patch)
tree9f41322f818ac67c09833380209dbaaa79c6a56f
parentddfe57f9a5c8bf55ef370b1a26d9ed0fee62196c (diff)
downloadlibxkbcommon-accepted/tizen_unified_riscv.tar.gz
libxkbcommon-accepted/tizen_unified_riscv.tar.bz2
libxkbcommon-accepted/tizen_unified_riscv.zip
Change-Id: I845ecb7e7fc6b6242e755a336f0e7e1429ae4bf9 Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
-rw-r--r--src/atom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/atom.c b/src/atom.c
index d43ac38..925ca13 100644
--- a/src/atom.c
+++ b/src/atom.c
@@ -148,6 +148,9 @@ atom_intern(struct atom_table *table, const char *string, size_t len, bool add)
if (darray_size(table->strings) > 0.80 * table->index_size) {
table->index_size *= 2;
table->index = realloc(table->index, table->index_size * sizeof(*table->index));
+ if (!table->index)
+ return XKB_ATOM_NONE;
+
memset(table->index, 0, table->index_size * sizeof(*table->index));
for (size_t j = 1; j < darray_size(table->strings); j++) {
const char *s = darray_item(table->strings, j);