Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: joyent/libuv
base: f3d311edc447
Choose a base ref
...
head repository: joyent/libuv
compare: 7c6bddbe2a69
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 18, 2013

  1. unix: fix a possible memory leak in uv_fs_readdir

    Some scandir implementations allocate the dirent struct even if the
    directory is empty, so if `scandir` returns 0 there may still be memory
    that needs to get deallocated. I have altered uv__fs_readdir to go to
    the "deallocation exit area" when 0 files are found in the directory
    and continue to return early on a return value of -1.
    
    I went to add a test for this functionality, but it appears that one
    already exists (reading an empty directory), so I imagine that the
    valgrind builds must only be happening on linux instead of OSX as well?
    I have confirmed manually that a program without this fix will
    infinitely leak memory, and with this fix the memory usage stays
    constant.
    alexcrichton authored and indutny committed Dec 18, 2013
    Copy the full SHA
    7c6bddb View commit details
    Browse the repository at this point in the history