threads / discuss / 39656

Fwd: New Defects reported by Coverity Scan for git

Subject: Fwd: New Defects reported by Coverity Scan for git

## tl;dr

2 messages between Jun 17, 2015 and Jun 17, 2015.

replies: 1people: 2as markdown or json

Duy Nguyen· Jun 17, 2015, 13:54 UTC · lore
I think Coverity caught this correctly.

** CID 1306846: Memory - illegal accesses (USE_AFTER_FREE) /builtin/pull.c: 287 in config_get_rebase()

________________________________________________________________________________________________________ *** CID 1306846: Memory - illegal accesses (USE_AFTER_FREE) /builtin/pull.c: 287 in config_get_rebase() 281 282 if (curr_branch) { 283 char *key = xstrfmt("branch.%s.rebase", curr_branch->name); 284 285 if (!git_config_get_value(key, &value)) { 286 free(key);

>>>     CID 1306846:  Memory - illegal accesses  (USE_AFTER_FREE)
>>>     Passing freed pointer "key" as an argument to "parse_config_rebase".

287 return parse_config_rebase(key, value, 1); 288 } 289 290 free(key); 291 } 292

-- 
Duy
Paul Tan· Jun 17, 2015, 14:39 UTC · re: Duy Nguyen · lore

Re: New Defects reported by Coverity Scan for git

On Wed, Jun 17, 2015 at 9:54 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 24 quoted lines
> I think Coverity caught this correctly.
>
> ** CID 1306846:  Memory - illegal accesses  (USE_AFTER_FREE)
> /builtin/pull.c: 287 in config_get_rebase()
>
>
> ________________________________________________________________________________________________________
> *** CID 1306846:  Memory - illegal accesses  (USE_AFTER_FREE)
> /builtin/pull.c: 287 in config_get_rebase()
> 281
> 282             if (curr_branch) {
> 283                     char *key = xstrfmt("branch.%s.rebase",
> curr_branch->name);
> 284
> 285                     if (!git_config_get_value(key, &value)) {
> 286                             free(key);
>>>>     CID 1306846:  Memory - illegal accesses  (USE_AFTER_FREE)
>>>>     Passing freed pointer "key" as an argument to "parse_config_rebase".
> 287                             return parse_config_rebase(key, value, 1);
> 288                     }
> 289
> 290                     free(key);
> 291             }
> 292
Ugh, thanks. ><

Regards, Paul

← back to recent threads