summaryrefslogtreecommitdiffstats
path: root/dimension/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-03-12 17:19:25 -0500
committerTavian Barnes <tavianator@gmail.com>2010-03-12 17:19:25 -0500
commita52e8bc7f279b3932f9ac5c241207b4509c9bd99 (patch)
tree3b5b2f4514a6f0a336aecda9588d4df53c193922 /dimension/parse.c
parent13a0ea225fb89fe1928303faf9fa23afe355ab97 (diff)
downloaddimension-a52e8bc7f279b3932f9ac5c241207b4509c9bd99.tar.xz
Check for realloc() failures.
Diffstat (limited to 'dimension/parse.c')
-rw-r--r--dimension/parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dimension/parse.c b/dimension/parse.c
index 7897b86..9f4a783 100644
--- a/dimension/parse.c
+++ b/dimension/parse.c
@@ -134,6 +134,8 @@ dmnsn_patricia_insert(dmnsn_patricia_trie *trie,
/* Split the tree */
dmnsn_patricia_trie *copy = dmnsn_new_patricia_trie();
copy->prefix = realloc(copy->prefix, strlen(prefix) + 1);
+ if (!trie->prefix)
+ dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't allocate room for prefix.");
strcpy(copy->prefix, prefix);
*prefix = '\0';