Skip to content

Commit 3dd10a8

Browse files
committed
fix debug info
1 parent 1298425 commit 3dd10a8

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

topic_partition.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,30 +97,31 @@ kafka_topic_partition_intern * get_topic_partition_object(zval *z) /* {{{ */
9797

9898
static HashTable *get_debug_info(Z_KAFKA_OBJ *object, int *is_temp) /* {{{ */
9999
{
100-
zval ary;
100+
zval arr;
101101
object_intern *intern;
102102

103103
*is_temp = 1;
104104

105-
array_init(&ary);
105+
array_init(&arr);
106106

107107
intern = kafka_get_debug_object(object_intern, object);
108108

109109
if (!intern) {
110-
return Z_ARRVAL(ary);
110+
return Z_ARRVAL(arr);
111111
}
112112

113113
if (intern->topic) {
114-
add_assoc_string(&ary, "topic", intern->topic);
114+
add_assoc_string(&arr, "topic", intern->topic);
115115
} else {
116-
add_assoc_null(&ary, "topic");
116+
add_assoc_null(&arr, "topic");
117117
}
118118

119-
add_assoc_long(&ary, "partition", intern->partition);
120-
add_assoc_long(&ary, "offset", intern->offset);
121-
add_assoc_zval(&ary, "metadata", &intern->metadata);
119+
add_assoc_long(&arr, "partition", intern->partition);
120+
add_assoc_long(&arr, "offset", intern->offset);
121+
Z_TRY_ADDREF_P(&intern->metadata);
122+
add_assoc_zval(&arr, "metadata", &intern->metadata);
122123

123-
return Z_ARRVAL(ary);
124+
return Z_ARRVAL(arr);
124125
}
125126
/* }}} */
126127

0 commit comments

Comments
 (0)