summaryrefslogtreecommitdiff
path: root/FreeRTOS/Source
diff options
context:
space:
mode:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2013-12-24 10:47:52 +0000
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2013-12-24 10:47:52 +0000
commitf1db26c7b8c8e95c3fefbc4960935040739b6027 (patch)
tree75de135e61aa8e439b8ca22d10bcb92ea6bde96b /FreeRTOS/Source
parent9122b634c3146460e03e59d20815242e9b70f1c6 (diff)
downloadfreertos-f1db26c7b8c8e95c3fefbc4960935040739b6027.tar.gz
Don't free xQueue->ucHead if it is NULL.
git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2140 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'FreeRTOS/Source')
-rw-r--r--FreeRTOS/Source/queue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/FreeRTOS/Source/queue.c b/FreeRTOS/Source/queue.c
index d33db5458..724c43864 100644
--- a/FreeRTOS/Source/queue.c
+++ b/FreeRTOS/Source/queue.c
@@ -126,13 +126,12 @@ typedef struct QueueDefinition
{
signed char *pcHead; /*< Points to the beginning of the queue storage area. */
signed char *pcTail; /*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
-
signed char *pcWriteTo; /*< Points to the free next place in the storage area. */
union /* Use of a union is an exception to the coding standard to ensure two mutually exclusive structure members don't appear simultaneously (wasting RAM). */
{
signed char *pcReadFrom; /*< Points to the last place that a queued item was read from when the structure is used as a queue. */
- unsigned portBASE_TYPE uxRecursiveCallCount;/*< Maintains a count of the numebr of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
+ unsigned portBASE_TYPE uxRecursiveCallCount;/*< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
} u;
xList xTasksWaitingToSend; /*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
@@ -1544,7 +1543,10 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
vQueueUnregisterQueue( pxQueue );
}
#endif
- vPortFree( pxQueue->pcHead );
+ if( pxQueue->pcHead != NULL )
+ {
+ vPortFree( pxQueue->pcHead );
+ }
vPortFree( pxQueue );
}
/*-----------------------------------------------------------*/