summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/ast_expr2.c2
-rw-r--r--main/ast_expr2.y2
-rw-r--r--main/astobj2_hash.c4
-rw-r--r--main/astobj2_rbtree.c2
4 files changed, 7 insertions, 3 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 781abd95a..a3c715ac1 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -3672,6 +3672,8 @@ op_tildetilde (struct val *a, struct val *b)
vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1);
if (vs == NULL) {
ast_log(LOG_WARNING, "malloc() failed\n");
+ free_value(a);
+ free_value(b);
return NULL;
}
diff --git a/main/ast_expr2.y b/main/ast_expr2.y
index 913bc2662..4f6087773 100644
--- a/main/ast_expr2.y
+++ b/main/ast_expr2.y
@@ -1665,6 +1665,8 @@ op_tildetilde (struct val *a, struct val *b)
vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1);
if (vs == NULL) {
ast_log(LOG_WARNING, "malloc() failed\n");
+ free_value(a);
+ free_value(b);
return NULL;
}
diff --git a/main/astobj2_hash.c b/main/astobj2_hash.c
index 1cd6ee249..341ff79e0 100644
--- a/main/astobj2_hash.c
+++ b/main/astobj2_hash.c
@@ -298,7 +298,7 @@ static enum ao2_container_insert hash_ao2_insert_node(struct ao2_container_hash
break;
case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
SWAP(cur->common.obj, node->common.obj);
- ao2_t_ref(node, -1, "Discard the new node.");
+ __ao2_ref(node, -1);
return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
}
}
@@ -331,7 +331,7 @@ static enum ao2_container_insert hash_ao2_insert_node(struct ao2_container_hash
break;
case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
SWAP(cur->common.obj, node->common.obj);
- ao2_t_ref(node, -1, "Discard the new node.");
+ __ao2_ref(node, -1);
return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
}
}
diff --git a/main/astobj2_rbtree.c b/main/astobj2_rbtree.c
index d8195d47f..a8d5e3ac1 100644
--- a/main/astobj2_rbtree.c
+++ b/main/astobj2_rbtree.c
@@ -1267,7 +1267,7 @@ static enum ao2_container_insert rb_ao2_insert_node(struct ao2_container_rbtree
break;
case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
SWAP(cur->common.obj, node->common.obj);
- ao2_t_ref(node, -1, "Don't need the new node.");
+ __ao2_ref(node, -1);
return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
}