@@ -53,8 +53,9 @@ DBA_CLOSE_FUNC(flatfile)
53
53
{
54
54
FLATFILE_DATA ;
55
55
56
- if (dba -> nextkey .dptr )
56
+ if (dba -> nextkey .dptr ) {
57
57
efree (dba -> nextkey .dptr );
58
+ }
58
59
pefree (dba , info -> flags & DBA_PERSISTENT );
59
60
}
60
61
@@ -67,8 +68,10 @@ DBA_FETCH_FUNC(flatfile)
67
68
FLATFILE_GKEY ;
68
69
69
70
gval = flatfile_fetch (dba , gkey TSRMLS_CC );
70
- if (gval .dptr ) {
71
- if (newlen ) * newlen = gval .dsize ;
71
+ if (gval .dptr ) {
72
+ if (newlen ) {
73
+ * newlen = gval .dsize ;
74
+ }
72
75
new = estrndup (gval .dptr , gval .dsize );
73
76
efree (gval .dptr );
74
77
}
@@ -104,7 +107,7 @@ DBA_EXISTS_FUNC(flatfile)
104
107
FLATFILE_GKEY ;
105
108
106
109
gval = flatfile_fetch (dba , gkey TSRMLS_CC );
107
- if (gval .dptr ) {
110
+ if (gval .dptr ) {
108
111
efree (gval .dptr );
109
112
return SUCCESS ;
110
113
}
@@ -122,12 +125,14 @@ DBA_FIRSTKEY_FUNC(flatfile)
122
125
{
123
126
FLATFILE_DATA ;
124
127
125
- if (dba -> nextkey .dptr )
128
+ if (dba -> nextkey .dptr ) {
126
129
efree (dba -> nextkey .dptr );
130
+ }
127
131
dba -> nextkey = flatfile_firstkey (dba TSRMLS_CC );
128
- if (dba -> nextkey .dptr ) {
129
- if (newlen )
132
+ if (dba -> nextkey .dptr ) {
133
+ if (newlen ) {
130
134
* newlen = dba -> nextkey .dsize ;
135
+ }
131
136
return estrndup (dba -> nextkey .dptr , dba -> nextkey .dsize );
132
137
}
133
138
return NULL ;
@@ -137,15 +142,18 @@ DBA_NEXTKEY_FUNC(flatfile)
137
142
{
138
143
FLATFILE_DATA ;
139
144
140
- if (!dba -> nextkey .dptr )
145
+ if (!dba -> nextkey .dptr ) {
141
146
return NULL ;
147
+ }
142
148
143
- if (dba -> nextkey .dptr )
149
+ if (dba -> nextkey .dptr ) {
144
150
efree (dba -> nextkey .dptr );
151
+ }
145
152
dba -> nextkey = flatfile_nextkey (dba TSRMLS_CC );
146
- if (dba -> nextkey .dptr ) {
147
- if (newlen )
153
+ if (dba -> nextkey .dptr ) {
154
+ if (newlen ) {
148
155
* newlen = dba -> nextkey .dsize ;
156
+ }
149
157
return estrndup (dba -> nextkey .dptr , dba -> nextkey .dsize );
150
158
}
151
159
return NULL ;
0 commit comments