浏览代码

core: Minor bug-fix: Only free path vector, if it contains data

Carsten Bock 11 年之前
父节点
当前提交
9e756aea48
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      parser/msg_parser.c

+ 2 - 1
parser/msg_parser.c

@@ -831,7 +831,8 @@ void reset_path_vector(struct sip_msg* const msg)
 {
 {
 	/* only free path vector from pkg IFF it is still in pkg... - ie. if msg is shm we don't free... */
 	/* only free path vector from pkg IFF it is still in pkg... - ie. if msg is shm we don't free... */
 	if (!(msg->msg_flags&FL_SHM_CLONE)) {
 	if (!(msg->msg_flags&FL_SHM_CLONE)) {
-		pkg_free(msg->path_vec.s);
+		if (msg->path_vec.s)
+			pkg_free(msg->path_vec.s);
 		msg->path_vec.s = 0;
 		msg->path_vec.s = 0;
 		msg->path_vec.len = 0;
 		msg->path_vec.len = 0;
 	}
 	}