author | Brandon Casey <casey@nrlssc.navy.mil> | |
Fri, 22 Aug 2008 00:16:30 +0000 (19:16 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 22 Aug 2008 07:15:37 +0000 (00:15 -0700) | ||
commit | 2cb1f36d5098060a4bac182da16ceed3197a57c2 | |
tree | f307204f169aec5535a89c246f79f7df537190c0 | tree | snapshot |
parent | a9da1663dfc869141749c768e9e0f52bb48218e3 | commit | diff |
remote.c: add a function for deleting a refspec array and use it (twice)
A number of call sites allocate memory for a refspec array, populate
its members with heap memory, and then free only the refspec pointer
while leaking the memory allocated for the member elements. Provide
a function for freeing the elements of a refspec array and the array
itself.
Caution to callers: code paths must be checked to ensure that the
refspec members "src" and "dst" can be passed to free.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
A number of call sites allocate memory for a refspec array, populate
its members with heap memory, and then free only the refspec pointer
while leaking the memory allocated for the member elements. Provide
a function for freeing the elements of a refspec array and the array
itself.
Caution to callers: code paths must be checked to ensure that the
refspec members "src" and "dst" can be passed to free.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | diff | blob | history | |
remote.h | diff | blob | history |