1. 28 Aug, 2010 1 commit
    • Julia Lawall's avatar
      net/ipv4: Eliminate kstrdup memory leak · c34186ed
      Julia Lawall authored
      The string clone is only used as a temporary copy of the argument val
      within the while loop, and so it should be freed before leaving the
      function.  The call to strsep, however, modifies clone, so a pointer to the
      front of the string is kept in saved_clone, to make it possible to free it.
      
      The sematic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E;
      identifier l;
      statement S;
      @@
      
      *x= \(kasprintf\|kstrdup\)(...);
      ...
      if (x == NULL) S
      ... when != kfree(x)
          when != E = x
      if (...) {
        <... when != kfree(x)
      * goto l;
        ...>
      * return ...;
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c34186ed
  2. 26 Aug, 2010 6 commits
  3. 25 Aug, 2010 1 commit
  4. 24 Aug, 2010 10 commits
  5. 23 Aug, 2010 3 commits
  6. 19 Aug, 2010 19 commits