mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: make string functions recognize NULL
This commit is contained in:
@ -70,6 +70,9 @@ sysprof_strings_get (SysprofStrings *self,
|
|||||||
{
|
{
|
||||||
GRefString *ret;
|
GRefString *ret;
|
||||||
|
|
||||||
|
if (string == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
g_mutex_lock (&self->mutex);
|
g_mutex_lock (&self->mutex);
|
||||||
if (!(ret = g_hash_table_lookup (self->hashtable, string)))
|
if (!(ret = g_hash_table_lookup (self->hashtable, string)))
|
||||||
{
|
{
|
||||||
@ -88,6 +91,9 @@ sysprof_strings_lookup (SysprofStrings *self,
|
|||||||
{
|
{
|
||||||
GRefString *ret;
|
GRefString *ret;
|
||||||
|
|
||||||
|
if (string == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
g_mutex_lock (&self->mutex);
|
g_mutex_lock (&self->mutex);
|
||||||
ret = g_hash_table_lookup (self->hashtable, string);
|
ret = g_hash_table_lookup (self->hashtable, string);
|
||||||
g_mutex_unlock (&self->mutex);
|
g_mutex_unlock (&self->mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user