Skip to content

Commit e312c65

Browse files
author
Mikhail Galanin
committed
Avoid using uninitialised struct
1 parent 81faab9 commit e312c65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/mysqlnd/mysqlnd_result.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
344344
}
345345
MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic);
346346
}
347+
PACKET_FREE(&fields_eof);
347348
} while (0);
348-
PACKET_FREE(&fields_eof);
349349
break; /* switch break */
350350
}
351351
} while (0);

ext/mysqlnd/mysqlnd_wireprotocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PHPAPI extern const char mysqlnd_read_body_name[];
3434
#define PACKET_FREE(packet) \
3535
do { \
3636
DBG_INF_FMT("PACKET_FREE(%p)", packet); \
37-
if ((packet)->header.m->free_mem) { \
37+
if ((packet)->header.m && (packet)->header.m->free_mem) { \
3838
((packet)->header.m->free_mem((packet))); \
3939
} \
4040
} while (0);

0 commit comments

Comments
 (0)