const struct ast_channel_snapshot *snapshot,
const char *prefix)
{
- struct ast_str *out = ast_str_create(1024);
- int res = 0;
- char *caller_name, *connected_name;
+ struct ast_str *out;
+ char *caller_name;
+ char *connected_name;
+ int res;
- if (!out) {
+ if (snapshot->tech_properties & AST_CHAN_TP_INTERNAL) {
return NULL;
}
- if (snapshot->tech_properties & AST_CHAN_TP_INTERNAL) {
- ast_free(out);
+ out = ast_str_create(1024);
+ if (!out) {
return NULL;
}
prefix, snapshot->uniqueid,
prefix, snapshot->linkedid);
+ ast_free(caller_name);
+ ast_free(connected_name);
+
if (!res) {
ast_free(out);
- ast_free(caller_name);
- ast_free(connected_name);
return NULL;
}
}
}
- ast_free(caller_name);
- ast_free(connected_name);
-
return out;
}