net: remove dead and redundant code
server cannot be NULL at this point (we return error earlier if it is). Also structure is zalloc'ed, so no need to explicitly initialize members to 0. Found by: Coverity scan. CID: 73837
This commit is contained in:
		
							parent
							
								
									269a522c7d
								
							
						
					
					
						commit
						528256932b
					
				
					 1 changed files with 4 additions and 11 deletions
				
			
		|  | @ -1322,20 +1322,13 @@ grub_net_open_real (const char *name) | |||
| 	    if (!ret) | ||||
| 	      return NULL; | ||||
| 	    ret->protocol = proto; | ||||
| 	    if (server) | ||||
| 	    ret->server = grub_strdup (server); | ||||
| 	    if (!ret->server) | ||||
| 	      { | ||||
| 		ret->server = grub_strdup (server); | ||||
| 		if (!ret->server) | ||||
| 		  { | ||||
| 		    grub_free (ret); | ||||
| 		    return NULL; | ||||
| 		  } | ||||
| 		grub_free (ret); | ||||
| 		return NULL; | ||||
| 	      } | ||||
| 	    else | ||||
| 	      ret->server = NULL; | ||||
| 	    ret->fs = &grub_net_fs; | ||||
| 	    ret->offset = 0; | ||||
| 	    ret->eof = 0; | ||||
| 	    return ret; | ||||
| 	  } | ||||
|       } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue