cleanup: avoid dereferencing NULL pointers
This commit is contained in:
parent
5bbd7b5443
commit
ffb8b35424
@ -221,9 +221,12 @@ found:
|
|||||||
if( !last_dir )
|
if( !last_dir )
|
||||||
{
|
{
|
||||||
last_dir = sql_get_text_field(db, "SELECT PATH from DETAILS where ID = %lld", detailID);
|
last_dir = sql_get_text_field(db, "SELECT PATH from DETAILS where ID = %lld", detailID);
|
||||||
|
if( last_dir )
|
||||||
|
{
|
||||||
fname = strrchr(last_dir, '/');
|
fname = strrchr(last_dir, '/');
|
||||||
if( fname )
|
if( fname )
|
||||||
*fname = '\0';
|
*fname = '\0';
|
||||||
|
}
|
||||||
last_hash = hash;
|
last_hash = hash;
|
||||||
}
|
}
|
||||||
found++;
|
found++;
|
||||||
|
@ -1813,8 +1813,13 @@ SendResp_dlnafile(struct upnphttp *h, char *object)
|
|||||||
{
|
{
|
||||||
char *art;
|
char *art;
|
||||||
art = sql_get_text_field(db, "SELECT ALBUM_ART from DETAILS where ID = '%lld'", id);
|
art = sql_get_text_field(db, "SELECT ALBUM_ART from DETAILS where ID = '%lld'", id);
|
||||||
|
if (art)
|
||||||
|
{
|
||||||
SendResp_albumArt(h, art);
|
SendResp_albumArt(h, art);
|
||||||
sqlite3_free(art);
|
sqlite3_free(art);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Send404(h);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user