|
@@ -96,9 +96,11 @@ struct image * alloc_image ( struct uri *uri ) {
|
96
|
96
|
ref_init ( &image->refcnt, free_image );
|
97
|
97
|
if ( uri ) {
|
98
|
98
|
image->uri = uri_get ( uri );
|
99
|
|
- name = basename ( ( char * ) uri->path );
|
100
|
|
- if ( ( rc = image_set_name ( image, name ) ) != 0 )
|
101
|
|
- goto err_set_name;
|
|
99
|
+ if ( uri->path ) {
|
|
100
|
+ name = basename ( ( char * ) uri->path );
|
|
101
|
+ if ( ( rc = image_set_name ( image, name ) ) != 0 )
|
|
102
|
+ goto err_set_name;
|
|
103
|
+ }
|
102
|
104
|
}
|
103
|
105
|
|
104
|
106
|
return image;
|