Przeglądaj źródła

srutils/tmrec: reset pointer after free to avoid double deallocation

Daniel-Constantin Mierla 11 lat temu
rodzic
commit
69d43fbacd
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      lib/srutils/tmrec.c

+ 1 - 0
lib/srutils/tmrec.c

@@ -343,6 +343,7 @@ int tr_byxxx_init(tr_byxxx_t *_bxp, int _nr)
 	if(!_bxp->req)
 	if(!_bxp->req)
 	{
 	{
 		pkg_free(_bxp->xxx);
 		pkg_free(_bxp->xxx);
+		_bxp->xxx = NULL;
 		return -1;
 		return -1;
 	}
 	}