瀏覽代碼

Fixed ctrl^u double free()

Serj Kalichev 10 年之前
父節點
當前提交
69b97ae3a0
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      tinyrl/tinyrl.c

+ 3 - 1
tinyrl/tinyrl.c

@@ -354,8 +354,10 @@ static bool_t tinyrl_key_erase_line(tinyrl_t * this, int key)
 	/* release any old kill string */
 	lub_string_free(this->kill_string);
 
-	if (!this->point)
+	if (!this->point) {
+		this->kill_string = NULL;
 		return BOOL_TRUE;
+	}
 
 	end = this->point - 1;