Thread (126 messages) flat view 126 messages, 3 authors, 2017-01-09

Re: [PATCH v3 06/16] pathspec: copy and free owned memory

From: Duy Nguyen <hidden>
Date: 2017-01-03 12:07:10

On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams [off-list ref] wrote:
 void clear_pathspec(struct pathspec *pathspec)
 {
+       int i;
+
+       for (i = 0; i < pathspec->nr; i++) {
+               free(pathspec->items[i].match);
+               free(pathspec->items[i].original);
+       }
        free(pathspec->items);
        pathspec->items = NULL;
We should set pathspec->nr to zero so that calling this function again
won't cause any harm.
 }
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help