Browse Source

[fix] strsplit: double malloc: mleaks.

Moul 3 years ago
parent
commit
c210383567
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/ft_strsplit.c

+ 1 - 2
src/ft_strsplit.c

@@ -6,7 +6,7 @@
 /*   By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2014/12/08 19:26:52 by mazimi            #+#    #+#             */
-/*   Updated: 2015/03/04 12:01:35 by mazimi           ###   ########.fr       */
+/*   Updated: 2017/01/31 12:55:00 by mazimi           ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -54,7 +54,6 @@ char			**ft_strsplit(char const *s, char c)
 		start = i;
 		while (s[i] && s[i] != c)
 			i++;
-		tab[j] = malloc((sizeof(char *)) * ((i - start) + 1));
 		tab[j] = ft_strsub(s, start, i - start);
 		i++;
 	}