Explorar o código

Fixed ctrl^u double free()

Serj Kalichev %!s(int64=10) %!d(string=hai) anos
pai
achega
d0a9448c43
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;