File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/interfaces/ecpg/pgtypeslib Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -430,14 +430,18 @@ PGTYPESnumeric_to_asc(numeric *num, int dscale)
430
430
numeric * numcopy = PGTYPESnumeric_new ();
431
431
char * s ;
432
432
433
- if (dscale < 0 )
434
- dscale = num -> dscale ;
433
+ if (numcopy == NULL )
434
+ return NULL ;
435
435
436
436
if (PGTYPESnumeric_copy (num , numcopy ) < 0 )
437
437
{
438
438
PGTYPESnumeric_free (numcopy );
439
439
return NULL ;
440
440
}
441
+
442
+ if (dscale < 0 )
443
+ dscale = num -> dscale ;
444
+
441
445
/* get_str_from_var may change its argument */
442
446
s = get_str_from_var (numcopy , dscale );
443
447
PGTYPESnumeric_free (numcopy );
@@ -1520,6 +1524,9 @@ numericvar_to_double(numeric *var, double *dp)
1520
1524
char * endptr ;
1521
1525
numeric * varcopy = PGTYPESnumeric_new ();
1522
1526
1527
+ if (varcopy == NULL )
1528
+ return -1 ;
1529
+
1523
1530
if (PGTYPESnumeric_copy (var , varcopy ) < 0 )
1524
1531
{
1525
1532
PGTYPESnumeric_free (varcopy );
You can’t perform that action at this time.
0 commit comments