Skip to contentSkip to conversation

New Defects reported by Coverity Scan for git

DISCUSSION Duy Nguyen 2 participants 2 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Duy Nguyen

author
#1 lore raw

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);

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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

Signature · 1 line
Duy
#2 lore raw
Quoted 16 lines · Duy Nguyen

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);

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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