Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9fad4cb

Browse files
author
Neil Conway
committed
Fix some minor infelicities in ecpg's pgtypeslib: (1) `pstr' must be
non-NULL in this function, so there is no need to check for it (2) weshould check the return value of pgtypes_strdup(). Patch from EricAstor at EnterpriseDB, with slight cleanup by myself, per a reportfrom the Coverity tool.
1 parent898a7bd commit9fad4cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/interfaces/ecpg/pgtypeslib/dt_common.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,8 +2669,7 @@ pgtypes_defmt_scan(union un_fmt_comb * scan_val, int scan_type, char **pstr, cha
26692669
if (!pstr_end)
26702670
{
26712671
/* there was an error, no match */
2672-
err=1;
2673-
returnerr;
2672+
return1;
26742673
}
26752674
last_char=*pstr_end;
26762675
*pstr_end='\0';
@@ -2699,8 +2698,10 @@ pgtypes_defmt_scan(union un_fmt_comb * scan_val, int scan_type, char **pstr, cha
26992698
err=1;
27002699
break;
27012700
casePGTYPES_TYPE_STRING_MALLOCED:
2702-
if (pstr)
2703-
scan_val->str_val=pgtypes_strdup(*pstr);
2701+
scan_val->str_val=pgtypes_strdup(*pstr);
2702+
if (scan_val->str_val==NULL)
2703+
err=1;
2704+
break;
27042705
}
27052706
if (strtol_end&&*strtol_end)
27062707
*pstr=strtol_end;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp