title: Memory Leak - Valgrind - "0 bytes lost in 59 blocks"
body: <p>Valgrind says that I have a memory leak of 59 bytes in 59 blocks because of my function ft_strdup :</p>
  
  <pre><code>char            *ft_strdup(const char *s)
  {
      char    *dup;
      int     i;
  
      i = 0;
      dup = (char *)malloc((ft_strlen(s) + 1) * sizeof(char));
      if (!dup)
          return (NULL);
      while (s[i])
      {
          dup[i] = s[i];
          i++;
      }
      dup[i] = '\0';
      return (dup);
  }
  </code></pre>
  
  <p>But when I change the size of the allocation to :</p>
  
  <p><code>dup = (char *)malloc(ft_strlen(s) * sizeof(char));</code></p>
  
  <p>Valgrind shows me this result :</p>
  
  <pre><code>==36929==    definitely lost: 0 bytes in 59 blocks
  ==36929==    indirectly lost: 0 bytes in 0 blocks
  </code></pre>
  
  <p>Why the 59 blocks still shows up instead of 0 blocks since there isn't any bytes lost?</p>